From 10d56f318f90ef0e505ae99a81d286837b0bdc05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 15 May 2011 20:26:37 +0100 Subject: [PATCH] Add Size#isZero(). --- src/basic/Size.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/basic/Size.js b/src/basic/Size.js index 471f53b5..55c7f005 100644 --- a/src/basic/Size.js +++ b/src/basic/Size.js @@ -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); },