Add Size#isZero().

This commit is contained in:
Jürg Lehni 2011-05-15 20:26:37 +01:00
parent 638d768406
commit 10d56f318f

View file

@ -81,6 +81,15 @@ var Size = this.Size = Base.extend({
return this.width == size.width && this.height == size.height;
},
/**
* Checks if this size has both the width and height set to 0.
*
* @return true if both width and height are 0, false otherwise.
*/
isZero: function() {
return this.width == 0 && this.width == 0;
},
isNaN: function() {
return isNaN(this.width) || isNaN(this.height);
},