-
-
Notifications
You must be signed in to change notification settings - Fork 443
Fix moving of first/last vertex of polygons added in ring mode #7942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I don't mind this as a band-aid, but I think we should consider using normalised vertex coordinates, without duplicates, when selecting vertices, and then using the inverse map from np.unique (or whatever function we've used to deduplicate vertices) to move all the corresponding vertices. Happy to leave that for future PRs though. |
We need to rewrite many aspects of the Shapes layer, so get this simple PR to address the problem and left rewrite for the future. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7942 +/- ##
==========================================
+ Coverage 92.93% 92.96% +0.03%
==========================================
Files 647 647
Lines 60975 60979 +4
==========================================
+ Hits 56665 56689 +24
+ Misses 4310 4290 -20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Yes. It only fix problem of duplicated first/last point. Not interna 8000 l point for holes |
I think it's still letting me move just 1 though. |
@psobolewskiPhD this polygon is not a ring. Compare the first and last vertices: napari/examples/dev/poly-hole.py Line 49 in 7933ed5
napari/examples/dev/poly-hole.py Line 72 in 7933ed5
|
I wanted to loop back to this, but pulling it down it seems broken by the src layout change. 😢 |
OK I tested with |
References and relevant issues
Address problem pointed in #5770 (comment)
Description
If a polygon is added with same point as start and begin (implicit close) ring (same as geoJSON) and we use direct mode for edit, we move only one of this point, effectively adding an additional point to the polygon that is unexpected.
This PR fixes this, by moving both points at the same time.