Skip to content

Commit

Permalink
fix: undo fix zoom (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Nov 8, 2022
1 parent 43d68eb commit 7d67010
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/signature_pad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,9 @@ export default class SignaturePad extends SignatureEventTarget {
private _createPoint(x: number, y: number, pressure: number): Point {
const rect = this.canvas.getBoundingClientRect();

const dpr = Math.max(window.devicePixelRatio || 1, 1);
const zoom =
this.canvas.width && rect.width
? this.canvas.width / rect.width / dpr
: 1;

return new Point(
x - rect.left * zoom,
y - rect.top * zoom,
x - rect.left,
y - rect.top,
pressure,
new Date().getTime(),
);
Expand Down

0 comments on commit 7d67010

Please sign in to comment.