Check infinity in setCoords() if object has zero width

This commit is contained in:
Kienz 2013-05-09 12:14:00 +02:00
parent 6c3bfa5c92
commit d2d1c50872

View file

@ -222,7 +222,7 @@
Math.pow(this.currentWidth / 2, 2) +
Math.pow(this.currentHeight / 2, 2));
var _angle = Math.atan(this.currentHeight / this.currentWidth);
var _angle = Math.atan(isFinite(this.currentHeight / this.currentWidth) ? this.currentHeight / this.currentWidth : 0);
// offset added for rotate and scale actions
var offsetX = Math.cos(_angle + theta) * _hypotenuse,