mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-26 08:24:42 +00:00
Fix group coordinates
This commit is contained in:
parent
a4129c31e8
commit
42ce906e0d
3 changed files with 12 additions and 13 deletions
|
|
@ -995,9 +995,6 @@
|
|||
this._activeGroup = group;
|
||||
if (group) {
|
||||
group.canvas = this;
|
||||
group._calcBounds();
|
||||
group._updateObjectsCoords();
|
||||
group.setCoords();
|
||||
group.set('active', true);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@
|
|||
|
||||
return new fabric.Group(groupObjects, {
|
||||
originX: 'center',
|
||||
originY: 'center'
|
||||
originY: 'center',
|
||||
canvas: this
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -126,7 +127,8 @@
|
|||
else if (group.length > 1) {
|
||||
group = new fabric.Group(group.reverse(), {
|
||||
originX: 'center',
|
||||
originY: 'center'
|
||||
originY: 'center',
|
||||
canvas: this
|
||||
});
|
||||
this.setActiveGroup(group, e);
|
||||
group.saveCoords();
|
||||
|
|
|
|||
|
|
@ -670,14 +670,14 @@
|
|||
_onObjectAdded: function(obj) {
|
||||
this.stateful && obj.setupState();
|
||||
obj.canvas = this;
|
||||
if (obj._objects) {
|
||||
obj._calcBounds();
|
||||
for (var i = 0, len = obj._objects.length; i < len; i++) {
|
||||
obj._objects[i].canvas = this;
|
||||
this._onObjectAdded(obj._objects[i]);
|
||||
}
|
||||
obj._updateObjectsCoords();
|
||||
}
|
||||
//if (obj._objects) {
|
||||
// obj._calcBounds();
|
||||
// for (var i = 0, len = obj._objects.length; i < len; i++) {
|
||||
// obj._objects[i].canvas = this;
|
||||
// this._onObjectAdded(obj._objects[i]);
|
||||
// }
|
||||
// obj._updateObjectsCoords();
|
||||
//}
|
||||
obj.setCoords();
|
||||
this.fire('object:added', { target: obj });
|
||||
obj.fire('added');
|
||||
|
|
|
|||
Loading…
Reference in a new issue