Skip to content

Commit

Permalink
fix: initialize private properties. (#700)
Browse files Browse the repository at this point in the history
* Fix typescript script errors for uninitialised private properties.
Fixes #699

* Fix for default value for `_isEmpty`.
  • Loading branch information
paulferrett authored Feb 22, 2023
1 parent 2745955 commit fea7ec6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 7 additions & 1 deletion docs/js/signature_pad.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/signature_pad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ export default class SignaturePad extends SignatureEventTarget {
// Private stuff
/* tslint:disable: variable-name */
private _ctx: CanvasRenderingContext2D;
private _drawningStroke: boolean;
private _isEmpty: boolean;
private _lastPoints: Point[]; // Stores up to 4 most recent points; used to generate a new curve
private _data: PointGroup[]; // Stores all points in groups (one group per line or dot)
private _lastVelocity: number;
private _lastWidth: number;
private _drawningStroke = false;
private _isEmpty = true;
private _lastPoints: Point[] = []; // Stores up to 4 most recent points; used to generate a new curve
private _data: PointGroup[] = []; // Stores all points in groups (one group per line or dot)
private _lastVelocity = 0;
private _lastWidth = 0;
private _strokeMoveUpdate: (event: SignatureEvent) => void;
/* tslint:enable: variable-name */

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"strictNullChecks": true,
"strictFunctionTypes": true,
"alwaysStrict": true,
"strict": true,

"removeComments": true,
"newLine": "LF",
Expand Down

0 comments on commit fea7ec6

Please sign in to comment.