d3 / d3-zoom

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

The default filter should return false if event.ctrlKey. #181

Closed mbostock closed 4 years ago

mbostock commented 4 years ago

Ref. https://github.com/d3/d3-drag/issues/62

MwumLi commented 4 years ago

@mbostock Although this commit Fix #181 - ignore control-click. solve the curren issue, but it prevents the double-value pinch zoom operation under mac.

Now, if you want to use the two-finger pinch zoom in the v5 version, you must reset the filter:

zoom.filter(() => !d3.event.button);

Look demo: Mac 下双指捏合缩放 d3 v5