Fix group coordinates

This commit is contained in:
Tom French 2014-07-04 09:05:48 +01:00
parent a4129c31e8
commit 42ce906e0d
3 changed files with 12 additions and 13 deletions

View file

@ -995,9 +995,6 @@
this._activeGroup = group;
if (group) {
group.canvas = this;
group._calcBounds();
group._updateObjectsCoords();
group.setCoords();
group.set('active', true);
}
},

View file

@ -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();

View file

@ -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');