mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-18 10:31:08 +00:00
Allow flipping in fabric.Group to change the object positions permanently
This commit is contained in:
parent
0327a2dc99
commit
6e96b3f1fb
1 changed files with 13 additions and 0 deletions
|
|
@ -266,6 +266,19 @@
|
|||
*/
|
||||
_restoreObjectState: function(object) {
|
||||
|
||||
var center = object.getCenterPoint();
|
||||
center.x *= -1;
|
||||
center.y *= -1;
|
||||
var newOrigin = object.translateToOriginPoint(center, object.get('originX'), object.get('originY'));
|
||||
if (this.flipX) {
|
||||
object.set('flipX', true);
|
||||
object.set('left', newOrigin.x);
|
||||
}
|
||||
if (this.flipY) {
|
||||
object.set('flipY', true);
|
||||
object.set('top', newOrigin.y);
|
||||
}
|
||||
|
||||
var groupLeft = this.get('left'),
|
||||
groupTop = this.get('top'),
|
||||
groupAngle = this.getAngle() * (Math.PI / 180),
|
||||
|
|
|
|||
Loading…
Reference in a new issue