From 7b4455f29a40054c3c16dc32ba56a5113abe6e45 Mon Sep 17 00:00:00 2001 From: Jim Rodovich Date: Wed, 7 May 2014 10:25:34 -0500 Subject: [PATCH] Constrain rounded rect radii to half the width & height. --- 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 fdcec06a..15a3fc90 100644 --- a/src/shapes/rect.class.js +++ b/src/shapes/rect.class.js @@ -108,8 +108,8 @@ return; } - var rx = this.rx || 0, - ry = this.ry || 0, + var rx = Math.min(this.rx || 0, this.width / 2), + ry = Math.min(this.ry || 0, this.height / 2), w = this.width, h = this.height, x = -w / 2,