Skip to content

Instantly share code, notes, and snippets.

@plateaukao
Created June 13, 2018 16:58
Show Gist options
  • Save plateaukao/0bc78650e539efb5893e03856600c84f to your computer and use it in GitHub Desktop.
Save plateaukao/0bc78650e539efb5893e03856600c84f to your computer and use it in GitHub Desktop.
enhance undo feature
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