diff -r 5b3e1c4569e6 -r c5da8b706cde Viewer.py --- a/Viewer.py Wed Aug 27 16:55:16 2008 +0200 +++ b/Viewer.py Wed Aug 27 16:56:25 2008 +0200 @@ -848,9 +848,9 @@ return element return None - def FindBlockConnector(self, pos, exclude = True): + def FindBlockConnector(self, pos, direction = None, exclude = True): for block in self.Blocks: - result = block.TestConnector(pos, exclude) + result = block.TestConnector(pos, direction, exclude) if result: return result return None @@ -1116,6 +1116,8 @@ if self.DrawingWire: self.DrawingWire = False if self.SelectedElement is not None: + if element is None or element.TestHandle(pos) == (0, 0): + connector = self.FindBlockConnector(pos, self.SelectedElement.GetConnectionDirection()) if connector: event.Dragging = lambda : True self.SelectedElement.OnMotion(event, self.GetLogicalDC(), self.Scaling) @@ -1211,7 +1213,7 @@ dc = self.GetLogicalDC() if self.DrawingWire: pos = event.GetLogicalPosition(dc) - connector = self.FindBlockConnector(pos) + connector = self.FindBlockConnector(pos, self.SelectedElement.GetConnectionDirection()) if self.SelectedElement.EndConnected is not None: self.DrawingWire = False self.SelectedElement.StartConnected.HighlightParentBlock(False) @@ -1287,7 +1289,7 @@ self.rubberBand.OnMotion(event, dc, self.Scaling) elif self.Mode == MODE_SELECTION and self.SelectedElement: if self.DrawingWire: - connector = self.FindBlockConnector(pos, False) + connector = self.FindBlockConnector(pos, self.SelectedElement.GetConnectionDirection(), False) if not connector or self.SelectedElement.EndConnected == None: self.SelectedElement.ResetPoints() movex, movey = self.SelectedElement.OnMotion(event, dc, self.Scaling)