aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom
diff options
context:
space:
mode:
authorhwc4872012-05-14 16:41:04 -0700
committerhwc4872012-05-14 16:41:04 -0700
commit02e5fbb819f02d26a8a7179cf04021a0f6c6ddf6 (patch)
tree116c24749d2da136c3b9a2927738805cf40a4730 /js/lib/geom
parent00a2452d8158fdab00eec4bd5891b753c0b0ccf5 (diff)
downloadninja-02e5fbb819f02d26a8a7179cf04021a0f6c6ddf6.tar.gz
base canvas 2d rendering of radial gradient on size of the filled region only
Diffstat (limited to 'js/lib/geom')
-rwxr-xr-xjs/lib/geom/rectangle.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js
index cf0e7fc8..4415af43 100755
--- a/js/lib/geom/rectangle.js
+++ b/js/lib/geom/rectangle.js
@@ -537,7 +537,8 @@ exports.Rectangle = Object.create(GeomObj, {
537 537
538 if(this._fillColor.gradientMode) { 538 if(this._fillColor.gradientMode) {
539 if(this._fillColor.gradientMode === "radial") { 539 if(this._fillColor.gradientMode === "radial") {
540 gradient = ctx.createRadialGradient(w/2, h/2, 0, w/2, h/2, Math.max(w, h)/2); 540 var ww = w - 2*lw, hh = h - 2*lw;
541 gradient = ctx.createRadialGradient(w/2, h/2, 0, w/2-this._strokeWidth, h/2, Math.max(ww, hh)/2);
541 } else { 542 } else {
542 gradient = ctx.createLinearGradient(inset/2, h/2, w-inset, h/2); 543 gradient = ctx.createLinearGradient(inset/2, h/2, w-inset, h/2);
543 } 544 }