From 9c3843f1a96a5671f95c224f632cb35266161251 Mon Sep 17 00:00:00 2001 From: Alexandre Gerlic Date: Mon, 26 Nov 2012 15:32:07 +0100 Subject: [PATCH 1/2] add option showShadow --- src/jSignature.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jSignature.js b/src/jSignature.js index 3709d4a..4b89ae0 100644 --- a/src/jSignature.js +++ b/src/jSignature.js @@ -730,6 +730,7 @@ function jSignatureClass(parent, options, instanceExtensions) { ,'lineWidth' : 0 ,'minFatFingerCompensation' : -10 ,'showUndoButton': false + ,'showShadow' : true ,'data': [] } @@ -967,7 +968,7 @@ jSignatureClass.prototype.resetCanvas = function(data){ basicLine(ctx, lineoffset * 1.5, ch - lineoffset, cw - (lineoffset * 1.5), ch - lineoffset) ctx.strokeStyle = settings.color - if (!isCanvasEmulator){ + if (!isCanvasEmulator && settings.showShadow){ ctx.shadowColor = ctx.strokeStyle ctx.shadowOffsetX = ctx.lineWidth * 0.5 ctx.shadowOffsetY = ctx.lineWidth * -0.6 From cabd1b26cb83ab35b3deda397819bfe39aa72ea7 Mon Sep 17 00:00:00 2001 From: Alexandre Gerlic Date: Mon, 26 Nov 2012 16:34:39 +0100 Subject: [PATCH 2/2] only set shadowColor if showShadow is enabled --- src/jSignature.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jSignature.js b/src/jSignature.js index 4b89ae0..9fba26f 100644 --- a/src/jSignature.js +++ b/src/jSignature.js @@ -950,7 +950,7 @@ jSignatureClass.prototype.resetCanvas = function(data){ ctx.clearRect(0, 0, cw + 30, ch + 30) - ctx.shadowColor = ctx.fillStyle = settings['background-color'] + ctx.fillStyle = settings['background-color'] if (isCanvasEmulator){ // FLashCanvas fills with Black by default, covering up the parent div's background // hence we refill