graphics/LD_Objects.py
changeset 1258 441f31474b50
parent 1176 f4b434672204
child 1356 2d4cc768a1bc
--- a/graphics/LD_Objects.py	Fri Jun 14 10:49:14 2013 +0200
+++ b/graphics/LD_Objects.py	Fri Jun 14 10:52:08 2013 +0200
@@ -120,8 +120,10 @@
         self.RefreshBoundingBox()
     
     # Returns the block minimum size
-    def GetMinSize(self):
-        return LD_POWERRAIL_WIDTH, self.Extensions[0] + self.Extensions[1]
+    def GetMinSize(self, default=False):
+        height = (LD_LINE_SIZE * (len(self.Connectors) - 1)
+                  if default else 0)
+        return LD_POWERRAIL_WIDTH, height + self.Extensions[0] + self.Extensions[1]
     
     # Add a connector or a blank to this power rail at the last place
     def AddConnector(self):
@@ -279,7 +281,7 @@
     # Method called when a RightUp event have been generated
     def OnRightUp(self, event, dc, scaling):
         handle_type, handle = self.Handle
-        if handle_type == HANDLE_CONNECTOR:
+        if handle_type == HANDLE_CONNECTOR and self.Dragging and self.oldPos:
             wires = handle.GetWires()
             if len(wires) == 1:
                 if handle == wires[0][0].StartConnected: