# HG changeset patch # User lbessard # Date 1191599974 -7200 # Node ID 26c10e28ee3af763dc5be1992fc5d146a2281d41 # Parent 85875dcb77544145dc8d9c42a615f3f112bac0dc Bug on block without input or output fixed diff -r 85875dcb7754 -r 26c10e28ee3a graphics/FBD_Objects.py --- 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