From 1fad2956004ddb8e89f33e0c1b9ea0e97c016a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 7 Mar 2017 12:34:59 +0100 Subject: [PATCH] Facilitate minification. --- src/basic/Point.js | 3 ++- src/basic/Size.js | 3 ++- src/path/SegmentPoint.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/basic/Point.js b/src/basic/Point.js index 2efe55e7..effb42d4 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -747,7 +747,8 @@ var Point = Base.extend(/** @lends Point# */{ * @return {Boolean} {@true if both x and y are 0} */ isZero: function() { - return Numerical.isZero(this.x) && Numerical.isZero(this.y); + var isZero = Numerical.isZero; + return isZero(this.x) && isZero(this.y); }, /** diff --git a/src/basic/Size.js b/src/basic/Size.js index 16cf4092..af10e6b5 100644 --- a/src/basic/Size.js +++ b/src/basic/Size.js @@ -388,7 +388,8 @@ var Size = Base.extend(/** @lends Size# */{ * @return {Boolean} {@true if both width and height are 0} */ isZero: function() { - return Numerical.isZero(this.width) && Numerical.isZero(this.height); + var isZero = Numerical.isZero; + return isZero(this.width) && isZero(this.height); }, /** diff --git a/src/path/SegmentPoint.js b/src/path/SegmentPoint.js index 27c7974c..2ea2835d 100644 --- a/src/path/SegmentPoint.js +++ b/src/path/SegmentPoint.js @@ -73,10 +73,11 @@ var SegmentPoint = Point.extend({ }, isZero: function() { + var isZero = Numerical.isZero; // Provide our own version of Point#isZero() that does not use the x / y // accessors but the internal properties directly, for performance // reasons, since it is used a lot internally. - return Numerical.isZero(this._x) && Numerical.isZero(this._y); + return isZero(this._x) && isZero(this._y); }, isSelected: function() {