aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-09 10:36:32 -0800
committerNivesh Rajbhandari2012-03-09 10:36:32 -0800
commit3f80251670e187377f9f8ae4547328c8bf344977 (patch)
treee9048e6bc1981572ef85e6ef88e8e2a81a5a5602 /js
parent7793b312ef9490c90c3d2332849ab41d56950437 (diff)
downloadninja-3f80251670e187377f9f8ae4547328c8bf344977.tar.gz
Fixing radial gradient for rectangle.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/lib/geom/rectangle.js4
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 }