فهرست منبع

Fix some more bugs with vertex highlighting

The highlight was not cleared properly under some conditions.
Michael Pitidis 14 سال پیش
والد
کامیت
eda1c4ff86
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      canvas.py

+ 4 - 0
canvas.py

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