--- a/Viewer.py Sat Jun 28 19:00:04 2008 +0200
+++ b/Viewer.py Mon Jun 30 14:35:06 2008 +0200
@@ -1132,14 +1132,14 @@
self.RefreshRect(self.GetScrolledRect(rect), False)
elif connector:
self.DrawingWire = True
- pos = GetScaledEventPosition(event, self.GetLogicalDC(), self.Scaling)
+ scaled_pos = GetScaledEventPosition(event, self.GetLogicalDC(), self.Scaling)
if (connector.GetDirection() == EAST):
- wire = Wire(self, [wx.Point(pos.x, pos.y), EAST], [wx.Point(pos.x, pos.y), WEST])
+ wire = Wire(self, [wx.Point(pos.x, pos.y), EAST], [wx.Point(scaled_pos.x, scaled_pos.y), WEST])
else:
- wire = Wire(self, [wx.Point(pos.x, pos.y), WEST], [wx.Point(pos.x, pos.y), EAST])
- wire.oldPos = pos
+ wire = Wire(self, [wx.Point(pos.x, pos.y), WEST], [wx.Point(scaled_pos.x, scaled_pos.y), EAST])
+ wire.oldPos = scaled_pos
wire.Handle = (HANDLE_POINT, 0)
- wire.ProcessDragging(0, 0, False, self.Scaling)
+ wire.ProcessDragging(0, 0, False, None)
wire.Handle = (HANDLE_POINT, 1)
self.AddWire(wire)
if self.SelectedElement:
@@ -1393,11 +1393,14 @@
self.RefreshScrollBars()
self.RefreshRect(self.GetScrolledRect(self.SelectedElement.GetRedrawRect(0, scaling[1])), False)
elif keycode == wx.WXK_SPACE and self.SelectedElement is not None and self.SelectedElement.Dragging:
- self.CopyBlock(self.SelectedElement, wx.Point(*self.SelectedElement.GetPosition()))
- self.RefreshBuffer()
- self.RefreshScrollBars()
- self.ParentWindow.RefreshVariablePanel(self.TagName)
- self.SelectedElement.Refresh()
+ if self.IsBlock(self.SelectedElement) or self.IsComment(self.SelectedElement):
+ self.CopyBlock(self.SelectedElement, wx.Point(*self.SelectedElement.GetPosition()))
+ self.RefreshBuffer()
+ self.RefreshScrollBars()
+ self.ParentWindow.RefreshVariablePanel(self.TagName)
+ self.SelectedElement.Refresh()
+ else:
+ event.Skip()
else:
event.Skip()