Bug on Block bounding box fixed
authorgreg
Wed, 26 Nov 2008 09:07:27 +0100
changeset 289 151e73a02caf
parent 288 7611911a5c73
child 290 56c4fe6b7012
Bug on Block bounding box fixed
graphics/FBD_Objects.py
--- a/graphics/FBD_Objects.py	Wed Nov 26 09:07:08 2008 +0100
+++ b/graphics/FBD_Objects.py	Wed Nov 26 09:07:27 2008 +0100
@@ -115,7 +115,7 @@
         text_width, text_height = self.NameSize
         # Calculate the bounding box size
         bbx_x = self.Pos.x - max(min(1, len(self.Inputs)) * CONNECTOR_SIZE, (text_width - self.Size[0]) / 2)
-        bbx_width = self.Size[0] + 1 + (min(1, len(self.Inputs)) + min(1, len(self.Outputs))) * CONNECTOR_SIZE
+        bbx_width = max(self.Size[0] + 1 + (min(1, len(self.Inputs)) + min(1, len(self.Outputs))) * CONNECTOR_SIZE, text_width)
         if self.Name != "":
             bbx_y = self.Pos.y - (text_height + 2)
             bbx_height = self.Size[1] + (text_height + 2)