mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-10 06:44:44 +00:00
Fix active group's originX/originY
This commit is contained in:
parent
d0e60d7c5a
commit
15889d3677
1 changed files with 9 additions and 3 deletions
|
|
@ -529,8 +529,11 @@
|
|||
// and that object is not the actual target
|
||||
var objects = this.getObjects();
|
||||
var isActiveLower = objects.indexOf(this._activeObject) < objects.indexOf(target);
|
||||
var group = new fabric.Group(
|
||||
isActiveLower ? [ target, this._activeObject ] : [ this._activeObject, target ]);
|
||||
var groupObjects = isActiveLower
|
||||
? [ target, this._activeObject ]
|
||||
: [ this._activeObject, target ];
|
||||
|
||||
var group = new fabric.Group(groupObjects, { originX: 'center', originY: 'center' });
|
||||
|
||||
this.setActiveGroup(group);
|
||||
this._activeObject = null;
|
||||
|
|
@ -820,7 +823,10 @@
|
|||
this.setActiveObject(group[0], e);
|
||||
}
|
||||
else if (group.length > 1) {
|
||||
group = new fabric.Group(group.reverse());
|
||||
group = new fabric.Group(group.reverse(), {
|
||||
originX: 'center',
|
||||
originY: 'center'
|
||||
});
|
||||
this.setActiveGroup(group, e);
|
||||
group.saveCoords();
|
||||
this.fire('selection:created', { target: group });
|
||||
|
|
|
|||
Loading…
Reference in a new issue