d3 / d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.
https://d3js.org/d3-zoom
ISC License
507 stars 143 forks source link

Mouse wheel zoom has very large steps on Firefox (Ubuntu 16.04) #140

Closed ohenrik closed 5 years ago

ohenrik commented 6 years ago

Firefox on Ubuntu (16.04) has extremely large steps when zooming using the mouse wheel, something close to 3x as large as on chrome. Its close not unusable.

I tried reducing the "mousewheel.default.delta_multiplier_y" config variable in Firefox. By setting this down from 100 to 15 i get a scroll speed that is closer to Chrome. However the all scrolling on other pages are slow, pluss i cannot expect users of my website to adjust their scroll settings for Firefox :p

Is there something in D3-zoom i can do to improve this? Is any one else having this issue?

Herst commented 6 years ago

Known browser issue: https://stackoverflow.com/q/5527601/2261442 In the answer to this SO question you will see possible solutions which you can then use you overwrite the default wheelDelta function.

bhousel commented 5 years ago

We implemented a workaround for this in iD:

https://github.com/openstreetmap/iD/blob/f61c482188b1b747fdf528ac2992f6ed9e8a2b6a/modules/renderer/map.js#L376-L396

Herst commented 5 years ago

Another workaround: #157

mbostock commented 5 years ago

Closing as this is well-covered by #157 and the existing zoom.wheelDelta function.