mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-09 08:50:59 +00:00
Fix SVG rendering of lines and images in groups.
This commit is contained in:
parent
ada83ffff5
commit
0171b665be
5 changed files with 15 additions and 1 deletions
7
dist/all.js
vendored
7
dist/all.js
vendored
|
|
@ -9258,6 +9258,10 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|||
_render: function(ctx) {
|
||||
ctx.beginPath();
|
||||
|
||||
if (this.group) {
|
||||
ctx.translate(-this.group.width/2 + this.left, -this.group.height / 2 + this.top);
|
||||
}
|
||||
|
||||
// move from center (of virtual box) to its left/top corner
|
||||
ctx.moveTo(this.width === 1 ? 0 : (-this.width / 2), this.height === 1 ? 0 : (-this.height / 2));
|
||||
ctx.lineTo(this.width === 1 ? 0 : (this.width / 2), this.height === 1 ? 0 : (this.height / 2));
|
||||
|
|
@ -11958,6 +11962,9 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|||
ctx.save();
|
||||
var m = this.transformMatrix;
|
||||
this._resetWidthHeight();
|
||||
if (this.group) {
|
||||
ctx.translate(-this.group.width/2 + this.width/2, -this.group.height/2 + this.height/2);
|
||||
}
|
||||
if (m) {
|
||||
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
||||
}
|
||||
|
|
|
|||
2
dist/all.min.js
vendored
2
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.
|
|
@ -133,6 +133,9 @@
|
|||
ctx.save();
|
||||
var m = this.transformMatrix;
|
||||
this._resetWidthHeight();
|
||||
if (this.group) {
|
||||
ctx.translate(-this.group.width/2 + this.width/2, -this.group.height/2 + this.height/2);
|
||||
}
|
||||
if (m) {
|
||||
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,10 @@
|
|||
_render: function(ctx) {
|
||||
ctx.beginPath();
|
||||
|
||||
if (this.group) {
|
||||
ctx.translate(-this.group.width/2 + this.left, -this.group.height / 2 + this.top);
|
||||
}
|
||||
|
||||
// move from center (of virtual box) to its left/top corner
|
||||
ctx.moveTo(this.width === 1 ? 0 : (-this.width / 2), this.height === 1 ? 0 : (-this.height / 2));
|
||||
ctx.lineTo(this.width === 1 ? 0 : (this.width / 2), this.height === 1 ? 0 : (this.height / 2));
|
||||
|
|
|
|||
Loading…
Reference in a new issue