Skip to content

Commit

Permalink
Try to get szimek#411 incorporated
Browse files Browse the repository at this point in the history
  • Loading branch information
sdahlbac committed Jan 8, 2020
1 parent 028b538 commit a6e677f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/js/signature_pad.umd.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Signature Pad v3.0.0-beta.3 | https://github.com/szimek/signature_pad
* (c) 2018 Szymon Nowak | Released under the MIT license
* (c) 2020 Szymon Nowak | Released under the MIT license
*/

(function (global, factory) {
Expand Down Expand Up @@ -417,7 +417,7 @@
y += 3 * uu * t * curve.control1.y;
y += 3 * u * tt * curve.control2.y;
y += ttt * curve.endPoint.y;
var width = curve.startWidth + ttt * widthDelta;
var width = Math.min(curve.startWidth + ttt * widthDelta, this.maxWidth);
this._drawCurveSegment(x, y, width);
}
ctx.closePath();
Expand Down Expand Up @@ -503,7 +503,7 @@
var header = '<svg' +
' xmlns="http://www.w3.org/2000/svg"' +
' xmlns:xlink="http://www.w3.org/1999/xlink"' +
(" viewBox=\"" + minX + " " + minY + " " + maxX + " " + maxY + "\"") +
(" viewBox=\"" + minX + " " + minY + " " + this.canvas.width + " " + this.canvas.height + "\"") +
(" width=\"" + maxX + "\"") +
(" height=\"" + maxY + "\"") +
'>';
Expand Down
2 changes: 1 addition & 1 deletion src/signature_pad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ export default class SignaturePad {
'<svg' +
' xmlns="http://www.w3.org/2000/svg"' +
' xmlns:xlink="http://www.w3.org/1999/xlink"' +
` viewBox="${minX} ${minY} ${maxX} ${maxY}"` +
` viewBox="${minX} ${minY} ${this.canvas.width} ${this.canvas.height}"` +
` width="${maxX}"` +
` height="${maxY}"` +
'>';
Expand Down

0 comments on commit a6e677f

Please sign in to comment.