eclipse-glsp / glsp

Graphical language server platform for building web-based diagram editors
https://www.eclipse.dev/glsp
Other
200 stars 32 forks source link

MousePositionTracker position is wrong for nested diagrams #1399

Closed tortmayr closed 1 month ago

tortmayr commented 2 months ago

The GLSPMousePositionTracker calculates the wrong diagram relative position if the diagram is nested inside of other html elements (e.g. in Theia or VS Code).

It seems like the position tracker calculates the absolute position instead of the diagram local position. In the video below I added a console log in the mouseMove method of the GLSPMousePositionTracker. When moving near the diagram root you can see that the position should be near to {x:0,y:0} but instead it reports back the absolute position

https://github.com/user-attachments/assets/08f11534-b3f4-4d4e-866b-fb04e1eef34b