Fix for negative width on objects

This commit is contained in:
Steve Pemberton 2012-10-14 18:30:08 +01:00
parent da28b363e4
commit f11f83b0db
3 changed files with 10 additions and 0 deletions

5
dist/all.js vendored
View file

@ -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

Binary file not shown.

View file

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