Skip to content

Commit fb5ce6f

Browse files
committed
fix(canvas): restore first-vertex snap highlight when closing polygon
highlightClear() ran after self.update(), so the async paint event fired after the highlight had already been cleared. Clear at the top of the draw branch instead so the NEAR_VERTEX highlight set by the snap check is still present when the paint event runs.
1 parent 60b2bcc commit fb5ce6f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

labelme/widgets/canvas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ def mouseMoveEvent(self, a0: QtGui.QMouseEvent) -> None:
385385
self._update_status()
386386
return
387387

388+
self.current.highlightClear()
388389
if self.outOfPixmap(pos):
389390
# Don't allow the user to draw outside the pixmap.
390391
# Project the point to the pixmap's edges.
@@ -433,7 +434,6 @@ def mouseMoveEvent(self, a0: QtGui.QMouseEvent) -> None:
433434
self.line.close()
434435
assert len(self.line.points) == len(self.line.point_labels)
435436
self.update()
436-
self.current.highlightClear()
437437
self._update_status()
438438
return
439439

0 commit comments

Comments
 (0)