mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-30 01:54:44 +00:00
Fix rendering bug with objects in group that also have transform attribute.
This commit is contained in:
parent
a0d05624ed
commit
9d2f3d261b
6 changed files with 33 additions and 15 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*! Fabric.js Copyright 2008-2012, Printio (Juriy Zaytsev, Maxim Chernyak) */
|
||||
|
||||
var fabric = fabric || { version: "0.8.48" };
|
||||
var fabric = fabric || { version: "0.8.49" };
|
||||
|
||||
if (typeof exports != 'undefined') {
|
||||
exports.fabric = fabric;
|
||||
|
|
|
|||
21
dist/all.js
vendored
21
dist/all.js
vendored
|
|
@ -1,7 +1,7 @@
|
|||
/* build: `node build.js modules=ALL` */
|
||||
/*! Fabric.js Copyright 2008-2012, Printio (Juriy Zaytsev, Maxim Chernyak) */
|
||||
|
||||
var fabric = fabric || { version: "0.8.48" };
|
||||
var fabric = fabric || { version: "0.8.49" };
|
||||
|
||||
if (typeof exports != 'undefined') {
|
||||
exports.fabric = fabric;
|
||||
|
|
@ -7809,7 +7809,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|||
ctx.save();
|
||||
|
||||
var m = this.transformMatrix;
|
||||
if (m) {
|
||||
if (m && !this.group) {
|
||||
ctx.setTransform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
||||
}
|
||||
|
||||
|
|
@ -7830,10 +7830,19 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|||
}
|
||||
|
||||
if (this.group && this.type === 'rect') {
|
||||
ctx.translate(
|
||||
-this.group.width / 2 + this.width / 2,
|
||||
-this.group.height / 2 + this.height / 2
|
||||
);
|
||||
if (m) {
|
||||
ctx.translate(
|
||||
-this.group.width / 2,
|
||||
-this.group.height / 2
|
||||
);
|
||||
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
||||
}
|
||||
else {
|
||||
ctx.translate(
|
||||
-this.group.width / 2 + this.width / 2,
|
||||
-this.group.height / 2 + this.height / 2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this._render(ctx, noTransform);
|
||||
|
|
|
|||
4
dist/all.min.js
vendored
4
dist/all.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "fabric",
|
||||
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
|
||||
"version": "0.8.48",
|
||||
"version": "0.8.49",
|
||||
"author": "Juriy Zaytsev <kangax@gmail.com>",
|
||||
"keywords": ["canvas", "graphic", "graphics", "SVG", "node-canvas", "parser", "HTML5", "object model"],
|
||||
"repository": "git://github.com/kangax/fabric.js",
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@
|
|||
ctx.save();
|
||||
|
||||
var m = this.transformMatrix;
|
||||
if (m) {
|
||||
if (m && !this.group) {
|
||||
ctx.setTransform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
||||
}
|
||||
|
||||
|
|
@ -397,10 +397,19 @@
|
|||
}
|
||||
|
||||
if (this.group && this.type === 'rect') {
|
||||
ctx.translate(
|
||||
-this.group.width / 2 + this.width / 2,
|
||||
-this.group.height / 2 + this.height / 2
|
||||
);
|
||||
if (m) {
|
||||
ctx.translate(
|
||||
-this.group.width / 2,
|
||||
-this.group.height / 2
|
||||
);
|
||||
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
||||
}
|
||||
else {
|
||||
ctx.translate(
|
||||
-this.group.width / 2 + this.width / 2,
|
||||
-this.group.height / 2 + this.height / 2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this._render(ctx, noTransform);
|
||||
|
|
|
|||
Loading…
Reference in a new issue