Skip to content

Commit

Permalink
Use shift for precise wheel events to match keyboard (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
DTTerastar authored Nov 18, 2024
1 parent 5de4374 commit f93aab3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/ui/src/lib/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@
const handler = zoom()
.scaleExtent([0.5, 40])
.wheelDelta((event) => {
const factor = event.altKey ? 0.25 : 1.0;
return -event.deltaY * factor * 0.002;
})
.wheelDelta((event) => { return -(event.deltaY + event.deltaX * 0.25) * 0.002; })
.on('zoom', (e) => {
transform = e.transform;
});
Expand Down

0 comments on commit f93aab3

Please sign in to comment.