Skip to content

Commit 923f62b

Browse files
committed
(fix): fix incorrect isEmpty = true during strokeBegin
backport of v0.2.4 addition from 22d8019 - strokeBegin called reset(), which set isEmpty = true , which is a bug - moved isEmpty = true logic outside of reset() as the only place it actually needs to be set to true is in clear()
1 parent 9fa1be4 commit 923f62b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export default class SignatureCanvas extends Component {
5151
ctx.clearRect(0, 0, canvas.width, canvas.height)
5252
ctx.fillRect(0, 0, canvas.width, canvas.height)
5353
this._reset()
54+
this._isEmpty = true
5455
}
5556

5657
fromDataURL = (dataURL) => {
@@ -110,7 +111,6 @@ export default class SignatureCanvas extends Component {
110111
this.points = [];
111112
this._lastVelocity = 0;
112113
this._lastWidth = (this.props.minWidth + this.props.maxWidth) / 2
113-
this._isEmpty = true;
114114
this._ctx.fillStyle = this.props.penColor
115115
}
116116

0 commit comments

Comments
 (0)