svg-pan-zoom icon indicating copy to clipboard operation
svg-pan-zoom copied to clipboard

Add event listener on "dblClickZoom"

Open khalyomede opened this issue 5 years ago • 1 comments

Feature Request

- Feature description To be able to listen to a "dblClickZoom" event. We could listen to onDblClickZoom and beforeDblClickZoom.

- Reasons for adopting new feature To be able do differentiate a wheel zoom and a double click zoom.

- Is this a breaking change? (How will this affect existing functionality) This will involve breaking changes, because the old onZoom and beforeZoom will not listen the zoom produced after a double click zoom anymore.

khalyomede avatar May 14 '19 16:05 khalyomede

In addition, it would be great to have a beforeDblClick parameter similar to beforePan and beforeZoom, which can be used to conditionally disable only the double-click zoom.

The use case I'm encountering is that when using the pointer to click to do other things, I occasionally press it twice in rapid succession and accidentally zoom in. But, I don't want to disable the double-click zoom entirely, because it's very useful.

Instead I want the ability to do something like "on double-click, zoom in only if the Ctrl key is also pressed". But I only want this to be for double-click. If the mouse wheel is scrolled, that should always zoom whether or not Ctrl is pressed.

dave-doty avatar Dec 22 '19 21:12 dave-doty