Explorar o código

Fix some more bugs with vertex highlighting

The highlight was not cleared properly under some conditions.
Michael Pitidis %!s(int64=13) %!d(string=hai) anos
pai
achega
eda1c4ff86
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      canvas.py

+ 4 - 0
canvas.py

@@ -80,6 +80,8 @@ class Canvas(QWidget):
             self.deSelectShape()
 
     def unHighlight(self):
+        if self.hShape:
+            self.hShape.highlightClear()
         self.hVertex = self.hShape = None
 
     def selectedVertex(self):
@@ -146,6 +148,8 @@ class Canvas(QWidget):
             # check if we happen to be inside a shape.
             index = shape.nearestVertex(pos, self.epsilon)
             if index is not None:
+                if self.selectedVertex():
+                    self.hShape.highlightClear()
                 self.hVertex, self.hShape = index, shape
                 shape.highlightVertex(index, shape.MOVE_VERTEX)
                 self.overrideCursor(CURSOR_POINT)