nglviewer / ngl

WebGL protein viewer
http://nglviewer.org/ngl/
MIT License
664 stars 169 forks source link

Multi-touch zoom with multiple NGL instances #1033

Open bergwerf opened 6 months ago

bergwerf commented 6 months ago

If there are multiple NGL instances, then multi-touch zoom on one of them will zoom (but not pan!) every one of them. I think the issue is that touch events are attached to the document (such that handling continues if you are no longer hovering the element), but the touch move event does not determine if the event started in this instance of the viewer: https://github.com/nglviewer/ngl/blob/d242234becffbe91c11126079ed22e6930390584/src/stage/mouse-observer.ts#L399-L405