From c4723be3174b4948b52980a3a7e573fdcec58eb5 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 29 Sep 2022 16:29:54 +0800 Subject: [PATCH] Remove closePath() closePath "attempts to add a straight line from the current point to the start of the current sub-path" so for a straight line it does nothing, and for a curve it draws back to the start point so if you draw quickly you get an ugly two line effect. --- src/jSignature.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/jSignature.js b/src/jSignature.js index 5a36cd9..bb74834 100644 --- a/src/jSignature.js +++ b/src/jSignature.js @@ -467,14 +467,12 @@ var basicDot = function(ctx, x, y, size){ ctx.beginPath(); ctx.moveTo(startx, starty); ctx.lineTo(endx, endy); - ctx.closePath(); ctx.stroke(); } , basicCurve = function(ctx, startx, starty, endx, endy, cp1x, cp1y, cp2x, cp2y){ ctx.beginPath(); ctx.moveTo(startx, starty); ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, endx, endy); - ctx.closePath(); ctx.stroke(); } , strokeStartCallback = function(stroke) {