Fix bug in LDViewer with MouseEvents
authorlaurent
Mon, 20 Feb 2012 15:21:10 +0100
changeset 650 aaa3b02d42b1
parent 649 ea237e1431ec
child 651 34c1fa1a89a9
Fix bug in LDViewer with MouseEvents
LDViewer.py
--- a/LDViewer.py	Mon Feb 20 00:37:01 2012 +0100
+++ b/LDViewer.py	Mon Feb 20 15:21:10 2012 +0100
@@ -259,18 +259,18 @@
                 return i
         return None
 
-    def FindElement(self, event, exclude_group = False):
+    def FindElement(self, event, exclude_group = False, connectors = True):
         if self.GetDrawingMode() == FREEDRAWING_MODE:
-            return Viewer.FindElement(self, event, exclude_group)
+            return Viewer.FindElement(self, event, exclude_group, connectors)
         
         dc = self.GetLogicalDC()
         pos = event.GetLogicalPosition(dc)
         if self.SelectedElement and not isinstance(self.SelectedElement, (Graphic_Group, Wire)):
-            if self.SelectedElement.HitTest(pos) or self.SelectedElement.TestHandle(pos) != (0, 0):
+            if self.SelectedElement.HitTest(pos, connectors) or self.SelectedElement.TestHandle(pos) != (0, 0):
                 return self.SelectedElement
         elements = []
         for element in self.GetElements(sort_wires=True):
-            if element.HitTest(pos) or element.TestHandle(event) != (0, 0):
+            if element.HitTest(pos, connectors) or element.TestHandle(event) != (0, 0):
                 elements.append(element)
         if len(elements) == 1:
             return elements[0]