--- a/graphics/FBD_Objects.py Tue Oct 02 18:07:59 2007 +0200
+++ b/graphics/FBD_Objects.py Fri Oct 05 17:59:34 2007 +0200
@@ -92,17 +92,18 @@
def RefreshConnectors(self):
# Calculate the size for the connector lines
lines = max(len(self.Inputs), len(self.Outputs))
- linesize = max((self.Size[1] - BLOCK_LINE_SIZE) / lines, BLOCK_LINE_SIZE)
- # Update inputs positions
- position = BLOCK_LINE_SIZE + linesize / 2
- for input in self.Inputs:
- input.SetPosition(wx.Point(0, position))
- position += linesize
- # Update outputs positions
- position = BLOCK_LINE_SIZE + linesize / 2
- for output in self.Outputs:
- output.SetPosition(wx.Point(self.Size[0], position))
- position += linesize
+ if lines > 0:
+ linesize = max((self.Size[1] - BLOCK_LINE_SIZE) / lines, BLOCK_LINE_SIZE)
+ # Update inputs positions
+ position = BLOCK_LINE_SIZE + linesize / 2
+ for input in self.Inputs:
+ input.SetPosition(wx.Point(0, position))
+ position += linesize
+ # Update outputs positions
+ position = BLOCK_LINE_SIZE + linesize / 2
+ for output in self.Outputs:
+ output.SetPosition(wx.Point(self.Size[0], position))
+ position += linesize
self.RefreshConnected()
# Refresh the positions of wires connected to inputs and outputs