Created
June 13, 2018 16:58
-
-
Save plateaukao/0bc78650e539efb5893e03856600c84f to your computer and use it in GitHub Desktop.
enhance undo feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IPointGroup { | |
+ maxWidth: number; | |
color: string; | |
points: IBasicPoint[]; | |
} | |
@@ -230,6 +231,7 @@ export default class SignaturePad { | |
private _strokeBegin(event: MouseEvent | Touch): void { | |
const newPointGroup = { | |
color: this.penColor, | |
+ maxWidth: this.maxWidth, | |
points: [], | |
}; | |
@@ -429,7 +431,8 @@ export default class SignaturePad { | |
drawDot: SignaturePad["_drawDot"], | |
): void { | |
for (const group of pointGroups) { | |
- const { color, points } = group; | |
+ const { maxWidth, color, points } = group; | |
+ this.maxWidth = maxWidth; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment