mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-23 23:34:41 +00:00
Fix for negative width on objects
This commit is contained in:
parent
da28b363e4
commit
f11f83b0db
3 changed files with 10 additions and 0 deletions
5
dist/all.js
vendored
5
dist/all.js
vendored
|
|
@ -8265,6 +8265,11 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|||
this.currentWidth = (this.width + strokeWidth) * this.scaleX + padding * 2;
|
||||
this.currentHeight = (this.height + strokeWidth) * this.scaleY + padding * 2;
|
||||
|
||||
//If width is negative, make postive. Fixes path selection issue
|
||||
if(this.currentWidth < 0){
|
||||
this.currentWidth = Math.abs(this.currentWidth);
|
||||
}
|
||||
|
||||
this._hypotenuse = Math.sqrt(
|
||||
Math.pow(this.currentWidth / 2, 2) +
|
||||
Math.pow(this.currentHeight / 2, 2));
|
||||
|
|
|
|||
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
|
|
@ -645,6 +645,11 @@
|
|||
this.currentWidth = (this.width + strokeWidth) * this.scaleX + padding * 2;
|
||||
this.currentHeight = (this.height + strokeWidth) * this.scaleY + padding * 2;
|
||||
|
||||
//If width is negative, make postive. Fixes path selection issue
|
||||
if(this.currentWidth < 0){
|
||||
this.currentWidth = Math.abs(this.currentWidth);
|
||||
}
|
||||
|
||||
this._hypotenuse = Math.sqrt(
|
||||
Math.pow(this.currentWidth / 2, 2) +
|
||||
Math.pow(this.currentHeight / 2, 2));
|
||||
|
|
|
|||
Loading…
Reference in a new issue