Skip to content

Commit

Permalink
Merge pull request szimek#403 from Andries-Smit/patch-1
Browse files Browse the repository at this point in the history
Prevent drawCurve exceeding max width
  • Loading branch information
szimek authored Nov 10, 2018
2 parents e2af461 + 021ac90 commit 028b538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/signature_pad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export default class SignaturePad {
y += 3 * u * tt * curve.control2.y;
y += ttt * curve.endPoint.y;

const width = curve.startWidth + ttt * widthDelta;
const width = Math.min(curve.startWidth + ttt * widthDelta, this.maxWidth);
this._drawCurveSegment(x, y, width);
}

Expand Down

0 comments on commit 028b538

Please sign in to comment.