Facilitate minification.

This commit is contained in:
Jürg Lehni 2017-03-07 12:34:59 +01:00
parent 1ca23a681a
commit 1fad295600
3 changed files with 6 additions and 3 deletions

View file

@ -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);
},
/**

View file

@ -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);
},
/**

View file

@ -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() {