Fix bounding box of Variable Block when variable name displaying size is bigger than block size
authorlaurent
Tue, 19 Apr 2011 17:10:31 +0200
changeset 533 7081b52a8a2d
parent 532 63e141705d19
child 534 d506a353b3d3
Fix bounding box of Variable Block when variable name displaying size is bigger than block size
graphics/FBD_Objects.py
--- a/graphics/FBD_Objects.py	Tue Apr 19 17:09:03 2011 +0200
+++ b/graphics/FBD_Objects.py	Tue Apr 19 17:10:31 2011 +0200
@@ -519,6 +519,8 @@
             bbx_width = self.Size[0] + 2 * CONNECTOR_SIZE
         else:
             bbx_width = self.Size[0] + CONNECTOR_SIZE
+        bbx_x = min(bbx_x, self.Pos.x + (self.Size[0] - self.NameSize[0]) / 2)
+        bbx_width = max(bbx_width, self.NameSize[0])
         bbx_height = self.Size[1]
         if self.ExecutionOrder != 0:
             bbx_x = min(bbx_x, self.Pos.x + self.Size[0] - self.ExecutionOrderSize[0])