Fix unable to complete draw area due to wrong initial vertices#3835
Open
andreia-ferreira wants to merge 2 commits into
Open
Fix unable to complete draw area due to wrong initial vertices#3835andreia-ferreira wants to merge 2 commits into
andreia-ferreira wants to merge 2 commits into
Conversation
…r to simplify logic and fix a case where 2 initial vertices would be allowed in the beginning
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3835 +/- ##
============================================
- Coverage 67.08% 67.08% -0.01%
+ Complexity 1799 1796 -3
============================================
Files 405 405
Lines 10633 10629 -4
Branches 1396 1395 -1
============================================
- Hits 7133 7130 -3
+ Misses 2758 2757 -1
Partials 742 742
🚀 New features to boost your workflow:
|
shobhitagarwal1612
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #3679
Some users in a Ground training in Lao PDR reported that they were not able to complete polygon drawing because the 'Complete' button was disabled and no error message was displayed. This was caused by an issue where a duplicated first vertex would be created by tapping 'Add point' twice at the start of drawing.
commitTentativeVertexguarded against re-committing the same spot with_isTooClose = _vertices.size > 1. But this caused the 'Add point' button to remain enabled after adding 1 vertex, which allowed for the duplication and caused an invalid final geometry which made it impossible to close the polygon.This fix involves setting
isTooCloseto true after every committed vertex, which sets the 'Add Pointas disabled until the user moves the map again. There is also a small refactor inPolygonDrawingSessionImpl` to make sure the first vertex does stay in the correct place:committedVertices) and other for just the tentative vertex following the map center (cursor)setGeometry,removeLastVertex,redoLastVertex, andcheckVertexIntersectionwere simplified to operate through the derived vertices.Before
Screen_recording_20260713_120515.webm
After
Screen_recording_20260713_120709.webm
@shobhitagarwal1612 PTAL?