react-diagrams icon indicating copy to clipboard operation
react-diagrams copied to clipboard

Wheel zoom behavior

Open JokerNN opened this issue 9 years ago • 1 comments

Hello again

I've got 2 questions/notes regarding wheel zoom behavior.

  1. Current behavior seems opposite in comparison with all maps application. Looking at google maps: scroll up will zoom in, scroll down will zoom out. React-diagrams behaves in opposite way: scroll up will zoom out, scroll down will zoom in.

  2. Laptop trackpad pinch to zoom gesture works for diagram, but zooms extremely slow. (tested in Chrome and Firefox) It works in that way because browsers actually emits wheel event on pinch, but with smaller deltaY (up to 15, compared to regular one which is up to 500) So it zooms slowly and in opposite direction because of 1st point.

What I am suggesting:

  • I understand that reversing zoom direction for next version isn't really good idea for people who uses it already, so maybe we could have some property like inverseZoom
  • It is possible to detect pinch-zoom gesture using thumb rule like (e.ctrlKey === true && e.deltaY % 1 !== 0)
  • I can implement all of this if you agree that it's good to have

JokerNN avatar Sep 20 '17 16:09 JokerNN

sounds good to me :)

dylanvorster avatar Sep 20 '17 18:09 dylanvorster