mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-23 20:55:47 +00:00
Fix positioning of line and image instances when part of a group
This commit is contained in:
parent
6e725ae18b
commit
4be589019c
2 changed files with 6 additions and 3 deletions
|
|
@ -96,8 +96,10 @@
|
|||
|
||||
ctx.save();
|
||||
var m = this.transformMatrix;
|
||||
var isInPathGroup = this.group && this.group.type !== 'group';
|
||||
|
||||
// this._resetWidthHeight();
|
||||
if (this.group) {
|
||||
if (isInPathGroup) {
|
||||
ctx.translate(-this.group.width/2 + this.width/2, -this.group.height/2 + this.height/2);
|
||||
}
|
||||
if (m) {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@
|
|||
_render: function(ctx) {
|
||||
ctx.beginPath();
|
||||
|
||||
if (this.group) {
|
||||
var isInPathGroup = this.group && this.group.type !== 'group';
|
||||
if (isInPathGroup) {
|
||||
ctx.translate(-this.group.width/2 + this.left, -this.group.height / 2 + this.top);
|
||||
}
|
||||
|
||||
|
|
@ -193,4 +194,4 @@
|
|||
return new fabric.Line(points, object);
|
||||
};
|
||||
|
||||
})(typeof exports !== 'undefined' ? exports : this);
|
||||
})(typeof exports !== 'undefined' ? exports : this);
|
||||
|
|
|
|||
Loading…
Reference in a new issue