From 76314abd95061a15fc2722279bf9d15363e182ba Mon Sep 17 00:00:00 2001 From: Jim Rodovich Date: Wed, 7 May 2014 19:00:56 -0500 Subject: [PATCH] Optimize for common case of radius 0. --- src/shapes/rect.class.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shapes/rect.class.js b/src/shapes/rect.class.js index 15a3fc90..e99627be 100644 --- a/src/shapes/rect.class.js +++ b/src/shapes/rect.class.js @@ -108,8 +108,8 @@ return; } - var rx = Math.min(this.rx || 0, this.width / 2), - ry = Math.min(this.ry || 0, this.height / 2), + var rx = this.rx ? Math.min(this.rx, this.width / 2) : 0, + ry = this.ry ? Math.min(this.ry, this.height / 2) : 0, w = this.width, h = this.height, x = -w / 2,