diff --git a/src/utils/area_selection.py b/src/utils/area_selection.py index d451c11..aa4d58b 100644 --- a/src/utils/area_selection.py +++ b/src/utils/area_selection.py @@ -183,6 +183,13 @@ class AreaSelectionHandler: def toggle_selection_inversion(self) -> bool: """Invert the current active selection.""" + # Auto-complete polygon selection if user right-clicks after plotting points + if (self._selectionType == "polygon" + and self._selectionArea + and not self._selectionArea.is_active + and len(self._polygonPath) >= 3): + self._complete_polygon_selection() + if not self._selectionArea or not self._selectionArea.is_active: return False if not self._selectionArea.is_valid():