diff options
author | Nivesh Rajbhandari | 2012-03-07 15:31:20 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-07 15:31:20 -0800 |
commit | b6288e1ffe4ffe29a595bb1e146feb388503e2c4 (patch) | |
tree | 5b1e681f2602dfe79715a75404d907aaeb2ae9d5 /js/lib/geom/rectangle.js | |
parent | 5bef5c5f2f7ee45d4c619c65ab8e9307c30420b5 (diff) | |
download | ninja-b6288e1ffe4ffe29a595bb1e146feb388503e2c4.tar.gz |
gradient support for canvas-2d shapes.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/lib/geom/rectangle.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 d01d5b28..f13f624d 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, h/2-inset, w/2, h/2, h-2*inset); | 478 | gradient = ctx.createRadialGradient(w/2, h/2, 0, w/2, h/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, w/2, h/2, h); | 512 | gradient = ctx.createRadialGradient(w/2, h/2, h/2-inset, w/2, h/2, h/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 | } |