aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom/rectangle.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/geom/rectangle.js')
-rwxr-xr-xjs/lib/geom/rectangle.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js
index 91b1d426..8278f1a3 100755
--- a/js/lib/geom/rectangle.js
+++ b/js/lib/geom/rectangle.js
@@ -452,13 +452,13 @@ var Rectangle = function GLRectangle() {
452 // render the fill 452 // render the fill
453 ctx.beginPath(); 453 ctx.beginPath();
454 if (this._fillColor) { 454 if (this._fillColor) {
455 inset = Math.ceil( lw ) + 0.5; 455 inset = Math.ceil( lw );
456 456
457 if(this._fillColor.gradientMode) { 457 if(this._fillColor.gradientMode) {
458 if(this._fillColor.gradientMode === "radial") { 458 if(this._fillColor.gradientMode === "radial") {
459 gradient = ctx.createRadialGradient(w/2, h/2, 0, w/2, h/2, Math.max(w/2, h/2)-inset); 459 gradient = ctx.createRadialGradient(w/2, h/2, 0, w/2, h/2, Math.max(w, h)/2);
460 } else { 460 } else {
461 gradient = ctx.createLinearGradient(inset, h/2, w-2*inset, h/2); 461 gradient = ctx.createLinearGradient(inset/2, h/2, w-inset, h/2);
462 } 462 }
463 colors = this._fillColor.color; 463 colors = this._fillColor.color;
464 464
@@ -486,11 +486,11 @@ var Rectangle = function GLRectangle() {
486 // render the stroke 486 // render the stroke
487 ctx.beginPath(); 487 ctx.beginPath();
488 if (this._strokeColor) { 488 if (this._strokeColor) {
489 inset = Math.ceil( 0.5*lw ) + 0.5; 489 inset = Math.ceil( 0.5*lw );
490 490
491 if(this._strokeColor.gradientMode) { 491 if(this._strokeColor.gradientMode) {
492 if(this._strokeColor.gradientMode === "radial") { 492 if(this._strokeColor.gradientMode === "radial") {
493 gradient = ctx.createRadialGradient(w/2, h/2, Math.min(h/2, w/2)-inset, w/2, h/2, Math.max(h/2, w/2)); 493 gradient = ctx.createRadialGradient(w/2, h/2, Math.min(h, w)/2-inset, w/2, h/2, Math.max(h, w)/2);
494 } else { 494 } else {
495 gradient = ctx.createLinearGradient(0, h/2, w, h/2); 495 gradient = ctx.createLinearGradient(0, h/2, w, h/2);
496 } 496 }