diff --git a/src/basic/Rectangle.js b/src/basic/Rectangle.js index 70b58a54..e26f27f7 100644 --- a/src/basic/Rectangle.js +++ b/src/basic/Rectangle.js @@ -474,12 +474,12 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{ * @type Point */ - /** - * The area of the rectangle in square points. - * - * @type Number - * @bean - */ + /** + * The area of the rectangle in square points. + * + * @type Number + * @bean + */ getArea: function() { return this.width * this.height; }, diff --git a/src/tool/Tool.js b/src/tool/Tool.js index b6b95cc0..61b04ae8 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -87,9 +87,9 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{ setMinDistance: function(minDistance) { this._minDistance = minDistance; - if (this._minDistance != null && this._maxDistance != null - && this._minDistance > this._maxDistance) { - this._maxDistance = this._minDistance; + if (minDistance != null && this._maxDistance != null + && minDistance > this._maxDistance) { + this._maxDistance = minDistance; } }, @@ -106,8 +106,8 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{ setMaxDistance: function(maxDistance) { this._maxDistance = maxDistance; - if (this._minDistance != null && this._maxDistance != null - && this._maxDistance < this._minDistance) { + if (this._minDistance != null && maxDistance != null + && maxDistance < this._minDistance) { this._minDistance = maxDistance; } }, @@ -290,10 +290,9 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{ return false; // Produce a new point on the way to point if point is further // away than maxDistance - var maxDist = maxDistance != null ? maxDistance : 0; - if (maxDist != 0) { - if (distance > maxDist) { - point = this._point.add(vector.normalize(maxDist)); + if (maxDistance != null && maxDistance != 0) { + if (distance > maxDistance) { + point = this._point.add(vector.normalize(maxDistance)); } else if (matchMaxDistance) { return false; }