Skip to content

Add snap-to-point case where first point is snapped#10490

Open
archibald1418 wants to merge 2 commits intodevelopfrom
ov/test-snap-regression
Open

Add snap-to-point case where first point is snapped#10490
archibald1418 wants to merge 2 commits intodevelopfrom
ov/test-snap-regression

Conversation

@archibald1418
Copy link
Copy Markdown
Contributor

@archibald1418 archibald1418 commented Apr 16, 2026

Motivation and context

Found a bug in snap-to-point #10421 whereby a snapped polygon's first point is not snapping when it is on an another shape.
The following points snap correctly.
This bug is also crucial for 'Join polygons' #10362 feature, since in order for polygons to join correctly, they must have shared sides, with no gaps in between, which is typically achieved with the help of snap-to-point feature (if you are adding a polygon on top of something else)

Screen.Recording.2026-04-16.at.20.22.27.mov

How has this been tested?

Added a test scenario:

  • draw a rectangle
  • turn on snap-to-point
  • draw a polygon, starting from the rectangle's first point. Click in the region of the two point (previous test proved that delta region of 1.3*r is correct), put third point away, resulting in a triangle. Thus, the both shapes have a common side, the triangle should visually sit perfectly on the rectangle
  • check that the polygon's and the rectangle's first point are identical in global coordinates (=snapping is correct)

Currently the test is being skipped, awaiting for the fix

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

refactor polygon creation to use two draw methods
@archibald1418 archibald1418 requested review from klakhov and removed request for bsekachev April 16, 2026 19:24
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@archibald1418 archibald1418 added bug Something isn't working tests ui/ux labels Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working tests ui/ux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant