mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-21 22:44:42 +00:00
Fixes for group coordinates (coordinates now also generated before group is added to canvas)
This commit is contained in:
parent
02b0b20343
commit
5f8e0ee6ee
5 changed files with 15 additions and 18 deletions
11
dist/fabric.js
vendored
11
dist/fabric.js
vendored
|
|
@ -19314,7 +19314,9 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
extend(this, options);
|
||||
}
|
||||
this._setOpacityIfSame();
|
||||
//this.setCoords();
|
||||
this._calcBounds();
|
||||
this._updateObjectsCoords();
|
||||
this.setCoords();
|
||||
this.saveCoords();
|
||||
},
|
||||
|
||||
|
|
@ -19699,11 +19701,8 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
* @private
|
||||
*/
|
||||
_getBounds: function(aX, aY, onlyWidthHeight) {
|
||||
var ivt;
|
||||
if (this.canvas) {
|
||||
ivt = fabric.util.invertTransform(this.getViewportTransform());
|
||||
}
|
||||
var minXY = fabric.util.transformPoint(new fabric.Point(min(aX), min(aY)), ivt),
|
||||
var ivt = fabric.util.invertTransform(this.getViewportTransform()),
|
||||
minXY = fabric.util.transformPoint(new fabric.Point(min(aX), min(aY)), ivt),
|
||||
maxXY = fabric.util.transformPoint(new fabric.Point(max(aX), max(aY)), ivt),
|
||||
obj = {
|
||||
width: (maxXY.x - minXY.x) || 0,
|
||||
|
|
|
|||
2
dist/fabric.min.js
vendored
2
dist/fabric.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/fabric.min.js.gz
vendored
BIN
dist/fabric.min.js.gz
vendored
Binary file not shown.
9
dist/fabric.require.js
vendored
9
dist/fabric.require.js
vendored
|
|
@ -9899,6 +9899,9 @@ fabric.util.object.extend(fabric.Object.prototype, {
|
|||
extend(this, options);
|
||||
}
|
||||
this._setOpacityIfSame();
|
||||
this._calcBounds();
|
||||
this._updateObjectsCoords();
|
||||
this.setCoords();
|
||||
this.saveCoords();
|
||||
},
|
||||
_updateObjectsCoords: function() {
|
||||
|
|
@ -10099,11 +10102,7 @@ fabric.util.object.extend(fabric.Object.prototype, {
|
|||
this.set(this._getBounds(aX, aY, onlyWidthHeight));
|
||||
},
|
||||
_getBounds: function(aX, aY, onlyWidthHeight) {
|
||||
var ivt;
|
||||
if (this.canvas) {
|
||||
ivt = fabric.util.invertTransform(this.getViewportTransform());
|
||||
}
|
||||
var minXY = fabric.util.transformPoint(new fabric.Point(min(aX), min(aY)), ivt), maxXY = fabric.util.transformPoint(new fabric.Point(max(aX), max(aY)), ivt), obj = {
|
||||
var ivt = fabric.util.invertTransform(this.getViewportTransform()), minXY = fabric.util.transformPoint(new fabric.Point(min(aX), min(aY)), ivt), maxXY = fabric.util.transformPoint(new fabric.Point(max(aX), max(aY)), ivt), obj = {
|
||||
width: maxXY.x - minXY.x || 0,
|
||||
height: maxXY.y - minXY.y || 0
|
||||
};
|
||||
|
|
|
|||
|
|
@ -63,7 +63,9 @@
|
|||
extend(this, options);
|
||||
}
|
||||
this._setOpacityIfSame();
|
||||
//this.setCoords();
|
||||
this._calcBounds();
|
||||
this._updateObjectsCoords();
|
||||
this.setCoords();
|
||||
this.saveCoords();
|
||||
},
|
||||
|
||||
|
|
@ -448,11 +450,8 @@
|
|||
* @private
|
||||
*/
|
||||
_getBounds: function(aX, aY, onlyWidthHeight) {
|
||||
var ivt;
|
||||
if (this.canvas) {
|
||||
ivt = fabric.util.invertTransform(this.getViewportTransform());
|
||||
}
|
||||
var minXY = fabric.util.transformPoint(new fabric.Point(min(aX), min(aY)), ivt),
|
||||
var ivt = fabric.util.invertTransform(this.getViewportTransform()),
|
||||
minXY = fabric.util.transformPoint(new fabric.Point(min(aX), min(aY)), ivt),
|
||||
maxXY = fabric.util.transformPoint(new fabric.Point(max(aX), max(aY)), ivt),
|
||||
obj = {
|
||||
width: (maxXY.x - minXY.x) || 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue