jgraph / drawio

draw.io is a JavaScript, client-side editor for general diagramming.
https://www.drawio.com
Other
40.65k stars 7.57k forks source link

pinch (multi-touch) zoom not working #3402

Closed nbelyh closed 1 year ago

nbelyh commented 1 year ago

Is your feature request related to a problem? Please describe. Pinch zoom (multi-touch) is not working on mobile. It "kind of" works on iOS (with an safari-specific workaround), still following the zoom only approximately (see related issue), on android it's not working at all. Instead, when doing multi-touch the drawing just jumps. See related issues: https://github.com/jgraph/drawio/issues?q=is%3Aissue+pinch

Describe the solution you'd like Pinch zoom is working similar to other applications, like google maps for example

Describe alternatives you've considered There are no alternatives, this needs to be a basic feature of the library, supporting multi-touch.

Related (in another fork): https://github.com/maxGraph/maxGraph/issues/62

davidjgraph commented 1 year ago

OK, but you're using maxGraph, so even if we make changes here that won't make any difference to maxGraph.

Also "not working" isn't a proper bug report. On iOS it works pretty well for me on Safari.

nbelyh commented 1 year ago

@davidjgraph No, I'm not using maxGraph. I understand that if you fix it here, it will not be fixed there automatically. I just added the link for reference, thinking it may give some idea what is to be done here. Yes, on iOS it kind of works, right 😄 Meaning, on iOS the mxgraph pinch steps are actually fixed, and do not exactly match with the touch distance, unlike google maps or other similar applications that support multi-touch properly (see the linked query - there are issues complaining about iOS as well)

Also, it's not a bug report, it's a feature request 😅 There is nothing broken here, it just never worked 😅

davidjgraph commented 1 year ago

"is not working" is not a proper bug report. There no version, no environment, no description of steps taken, no evidence of result.

nbelyh commented 1 year ago

@davidjgraph would it be better like this maybe:

Title support multitouch zoom ("pinch zoom") on touch devices.

Descripltion Most diagramming tools out there, like lucid charts for example, Visio, etc, support so-called "multitouch" pinch zoom. This is a zoom operation, when you put two fingers on the surface of the touch device, and then start moving your fingers either towards each other or outwards to zoom in or zoom out. This causes the diagram to zoom/rotate appropriately.

This operation is known as "pinch zoom". Please refer to the picture below: image

This feature is also implemented in most mapping (like Google Maps) solutions and image manipulation applications that run on mobile devices (like gallery on android).

I would like to have this functionality for draw.io

Currently, there is only limited implementation for iOS (Safari), that does not work on android, and also on iOS the steps are not matching the finger movement precisely (the implementation is using proprietary iOS features, and not the web standard).