thread-pond / signature-pad

A jQuery plugin for assisting in the creation of an HTML5 canvas based signature pad. Records the drawn signature in JSON for later regeneration.
BSD 3-Clause "New" or "Revised" License
727 stars 292 forks source link

penWidth does not work #144

Open ericlenio opened 9 years ago

ericlenio commented 9 years ago

Changing the value of penWidth has no effect, at least on Chrome 40 on Linux, or Firefox 35 on Linux. This patch works for me though.

diff --git a/jquery.signaturepad.js b/jquery.signaturepad.js
index b5205a4..bdb77c8 100755
--- a/jquery.signaturepad.js
+++ b/jquery.signaturepad.js
@@ -209,6 +209,7 @@ function SignaturePad (selector, options) {
     if (newYOffset)
       newY += newYOffset

+    canvasContext.lineWidth = settings.penWidth
     canvasContext.beginPath()
     canvasContext.moveTo(previous.x, previous.y)
     canvasContext.lineTo(newX, newY)