forked from jgraph/mxgraph
-
Notifications
You must be signed in to change notification settings - Fork 199
Open
Description
Describe the bug
When creating an edge from or to another edge, the preview shows incorrect terminal points:
- The start point is always fixed to one end of the edge, instead of matching the click position
- The end point also snaps to an endpoint, instead of following the cursor
Once the edge is finalized, the points are correct. But during the preview, the edge shape is misleading and seems to "jump" between preview and final rendering.
✅ No issue when connecting from/to vertices
❌ Problem only occurs when connecting from/to edges
This is very similar to what was reported in #841
To Reproduce
- Start creating an edge from an existing edge
- Drag toward another edge and observe the preview
- Preview doesn’t follow the cursor and sticks to edge endpoints
- Release → edge is created with correct geometry
Expected behavior
The preview should reflect the final geometry:
- Start point should match where the user clicked on the edge
- Target point should follow the mouse cursor, even when hovering an edge
Screenshots
Problem in maxGraph
maxgraph_pr-893_edge_wrong_points_while_creating.mp4
This was working in mxGraph 4.2.2. See https://jgraph.github.io/mxgraph/javascript/examples/wires.html
mxGraph_wires_example_working_edge_preview.mp4
Environment
maxGraphversion or commit:- Reproduced in PR refactor: fix most problems in the Wires story #893
- Also present before, in commit
74e44bcc(bug exists since a long time)
- OS and version: Ubuntu 24.04
- Browser and version:
- Chrome 138.0.7204.183
- Firefox 141.0
- Node/npm version: -
- Used frameworks (if applicable): -
Metadata
Metadata
Assignees
Labels
No labels