diff options
Diffstat (limited to 'js')
-rwxr-xr-x | js/lib/geom/rectangle.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js index f13f624d..81201a79 100755 --- a/js/lib/geom/rectangle.js +++ b/js/lib/geom/rectangle.js | |||
@@ -475,7 +475,7 @@ var Rectangle = function GLRectangle() { | |||
475 | 475 | ||
476 | if(this._fillColor.gradientMode) { | 476 | if(this._fillColor.gradientMode) { |
477 | if(this._fillColor.gradientMode === "radial") { | 477 | if(this._fillColor.gradientMode === "radial") { |
478 | gradient = ctx.createRadialGradient(w/2, h/2, 0, w/2, h/2, h/2-inset); | 478 | gradient = ctx.createRadialGradient(w/2, h/2, 0, w/2, h/2, Math.max(w/2, h/2)-inset); |
479 | } else { | 479 | } else { |
480 | gradient = ctx.createLinearGradient(inset, h/2, w-2*inset, h/2); | 480 | gradient = ctx.createLinearGradient(inset, h/2, w-2*inset, h/2); |
481 | } | 481 | } |
@@ -509,7 +509,7 @@ var Rectangle = function GLRectangle() { | |||
509 | 509 | ||
510 | if(this._strokeColor.gradientMode) { | 510 | if(this._strokeColor.gradientMode) { |
511 | if(this._strokeColor.gradientMode === "radial") { | 511 | if(this._strokeColor.gradientMode === "radial") { |
512 | gradient = ctx.createRadialGradient(w/2, h/2, h/2-inset, w/2, h/2, h/2); | 512 | gradient = ctx.createRadialGradient(w/2, h/2, Math.min(h/2, w/2)-inset, w/2, h/2, Math.max(h/2, w/2)); |
513 | } else { | 513 | } else { |
514 | gradient = ctx.createLinearGradient(0, h/2, w, h/2); | 514 | gradient = ctx.createLinearGradient(0, h/2, w, h/2); |
515 | } | 515 | } |