graphics/FBD_Objects.py
changeset 289 151e73a02caf
parent 287 fab9a51d5b57
child 379 e4c26ee9c998
equal deleted inserted replaced
288:7611911a5c73 289:151e73a02caf
   113     def RefreshBoundingBox(self):
   113     def RefreshBoundingBox(self):
   114         # Calculate the size of the name outside the block
   114         # Calculate the size of the name outside the block
   115         text_width, text_height = self.NameSize
   115         text_width, text_height = self.NameSize
   116         # Calculate the bounding box size
   116         # Calculate the bounding box size
   117         bbx_x = self.Pos.x - max(min(1, len(self.Inputs)) * CONNECTOR_SIZE, (text_width - self.Size[0]) / 2)
   117         bbx_x = self.Pos.x - max(min(1, len(self.Inputs)) * CONNECTOR_SIZE, (text_width - self.Size[0]) / 2)
   118         bbx_width = self.Size[0] + 1 + (min(1, len(self.Inputs)) + min(1, len(self.Outputs))) * CONNECTOR_SIZE
   118         bbx_width = max(self.Size[0] + 1 + (min(1, len(self.Inputs)) + min(1, len(self.Outputs))) * CONNECTOR_SIZE, text_width)
   119         if self.Name != "":
   119         if self.Name != "":
   120             bbx_y = self.Pos.y - (text_height + 2)
   120             bbx_y = self.Pos.y - (text_height + 2)
   121             bbx_height = self.Size[1] + (text_height + 2)
   121             bbx_height = self.Size[1] + (text_height + 2)
   122         else:
   122         else:
   123             bbx_y = self.Pos.y
   123             bbx_y = self.Pos.y