[Code health] Don't allow saving a duplicate vertex during polygon drawing session#3750
[Code health] Don't allow saving a duplicate vertex during polygon drawing session#3750shobhitagarwal1612 wants to merge 7 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3750 +/- ##
============================================
+ Coverage 68.06% 68.09% +0.03%
- Complexity 1613 1615 +2
============================================
Files 368 368
Lines 9528 9538 +10
Branches 1242 1244 +2
============================================
+ Hits 6485 6495 +10
Misses 2376 2376
Partials 667 667
🚀 New features to boost your workflow:
|
| _vertices = updatedVertices.toImmutableList() | ||
| } | ||
| override val hasSelfIntersection: Boolean | ||
| get() = isSelfIntersecting(displayVertices) |
There was a problem hiding this comment.
I can't seem to close the polygons. When debugging i noticed that isSelfIntersecting now returns true when getting the state of the complete button. It could be because now this method checks displayVertices which includes the tentativeVertex, and that is equal to the first vertex
Screen_recording_20260521_143226.webm
There was a problem hiding this comment.
I'm unable to reproduce this on my device. Are you able to consistently reproduce it or is it flaky?
There was a problem hiding this comment.
it's consistently reproducible. But I've found out it's because I was clicking twice to drop the first point because clicking the first time doesn't make the white circle marker to show up until the camera is dragged. So I believe the problem is that dropping two points in the starting vertex is allowed, but then leads to an invalid polygon
Towards #3679
Separate committed and tentative vertices in
PolygonDrawingSession. This allows the persistence layer to safely store only the committed vertices without having to assume that the last vertex is user committed vertex or not.Changes verified using unit tests and testing the flow on a physical device.
@andreia-ferreira PTAL?