Skip to content

Commit

Permalink
Merge pull request #358 from Zekiah-A/main
Browse files Browse the repository at this point in the history
Fix scroll wheel, only suppress trackpad zoom over canvas area
  • Loading branch information
Zekiah-A authored Nov 18, 2024
2 parents 92adfce + 0b1db98 commit dc4993c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3072,7 +3072,11 @@ <h4>Quest complete! 🥳</h4>
function cancelZoomGesture(e) {
e.preventDefault()
}
window.addEventListener("wheel", cancelZoomGesture, { passive: false })
window.addEventListener("wheel", function(e) {
if (e.target == maincontent || canvparent2.contains(e.target)) {
e.preventDefault()
}
}, { passive: false })
window.addEventListener("gesturestart", cancelZoomGesture)
window.addEventListener("gesturechange", cancelZoomGesture)
window.addEventListener("gestureend", cancelZoomGesture)
Expand Down

0 comments on commit dc4993c

Please sign in to comment.