graphics/LD_Objects.py
changeset 175 cc78572dfbbc
parent 165 e464a4e4e06d
child 180 3b0d3ea35ee5
--- a/graphics/LD_Objects.py	Tue Feb 26 15:41:18 2008 +0100
+++ b/graphics/LD_Objects.py	Wed Feb 27 11:12:28 2008 +0100
@@ -311,6 +311,10 @@
         else:
             self.Parent.PopupDefaultMenu()
     
+    def Resize(self, x, y, width, height):
+        self.Move(x, y)
+        self.SetSize(LD_POWERRAIL_WIDTH, height)
+
     # Refreshes the powerrail state according to move defined and handle selected
     def ProcessDragging(self, movex, movey, centered, scaling):
         handle_type, handle = self.Handle
@@ -341,7 +345,10 @@
         dc.SetPen(wx.BLACK_PEN)
         dc.SetBrush(wx.BLACK_BRUSH)
         # Draw a rectangle with the power rail size
-        dc.DrawRectangle(self.Pos.x, self.Pos.y, self.Size[0] + 1, self.Size[1] + 1)
+        if self.Type == LEFTRAIL:
+            dc.DrawRectangle(self.Pos.x + self.Size[0] - LD_POWERRAIL_WIDTH, self.Pos.y, LD_POWERRAIL_WIDTH + 1, self.Size[1] + 1)
+        else:
+            dc.DrawRectangle(self.Pos.x, self.Pos.y, LD_POWERRAIL_WIDTH + 1, self.Size[1] + 1)
         # Draw connectors
         for connector in self.Connectors:
             if connector: