Skip to content

Commit

Permalink
fix(zoom): translation in mac os
Browse files Browse the repository at this point in the history
force pointers reset on context menu
  • Loading branch information
Ni55aN committed Apr 1, 2024
1 parent dd419a3 commit 849f20e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class Zoom {

window.addEventListener('pointermove', this.move)
window.addEventListener('pointerup', this.up)
window.addEventListener('contextmenu', this.contextmenu)
window.addEventListener('pointercancel', this.up)
}

Expand Down Expand Up @@ -79,6 +80,10 @@ export class Zoom {
this.previous = { cx, cy, distance }
}

protected contextmenu = () => {
this.pointers = []
}

protected up = (e: PointerEvent) => {
this.previous = null
this.pointers = this.pointers.filter(p => p.pointerId !== e.pointerId)
Expand Down

0 comments on commit 849f20e

Please sign in to comment.