-
Notifications
You must be signed in to change notification settings - Fork 560
Description
Preflight Checklist
- [ x] I agree to follow the Code of Conduct that this project adheres to.
- [ x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
If you are technical, you should report bugs along the lines of https://marker.io/blog/how-to-write-bug-report. If you are not technical, we will make allowances, please try to make an effort to understand the process.
Describe the bug
When editing a Polygon shape in draw.io/diagrams.net, the vertex handles always snap to the grid or nearby geometry.
Holding Alt/(Options on Mac) — which normally allows smooth, unsnapped dragging for other handle types — does not disable snapping for polygon vertices.
This makes precise placement of polygon points very difficult.
To Reproduce
Steps to reproduce the behavior:
- Create a Polygon shape (Insert → Shape → General → Polygon, or create a custom polygon). Make it big, say 500x500 in order to see snapping
- Drag any vertex.
- Hold Alt/(Options on Mac) → snapping still occurs.
Expected behavior
- Holding Alt/(Options on Mac) should disable snapping for polygon vertices, consistent with how other shape handles behave.
draw.io version (In the Help->About menu of the draw.io editor):
- draw.io version 29.2.4
Desktop (please complete the following information):
- OS: MacOS
- Browser Chrome
- Browser Version Version 143.0.7499.41 (Offizieller Build) (arm64)
I tested the problem in incognito/private mode with all browser extensions switched off, write "yes" below:
- yes
Additional context
It looks like the snapping behavior may be caused by how polygon vertex coordinates are stored internally. While dragging a polygon vertex, the coordinates stored in the shape’s style (property polyCoords) appear to be normalized between 0 and 1 , relative fractions of the polygon’s width and height. However, while dragging, draw.io seems to round these fractional values to only two decimal places. This effectively would limit vertex placement to a 100 × 100 grid inside the polygon’s bounding box. For large polygons, this coarse quantization produces an unintended snapping effect, even when global snapping is disabled. Example: While dragging a vertex, coordinates like 0.13,0.47 are stored
Further exploration:
But if I manually edit the style, I can enter many more decimals (e.g., 0.134529) The polygon then renders at the more precise location, confirming that the rounding happens only during interactive dragging, not in the underlying rendering logic. This suggests that the snapping may not be intentional snapping at all, but rather an artifact of coordinate rounding during interactive editing.
A more precise fractional resolution (e.g., 4–6 decimals) would likely remove the undesired snapping.