970 return "negated" |
970 return "negated" |
971 else: |
971 else: |
972 return connector.GetEdge() |
972 return connector.GetEdge() |
973 return "none" |
973 return "none" |
974 |
974 |
|
975 def CorrectElementSize(self, element, width, height): |
|
976 min_width, min_height = element.GetMinSize() |
|
977 if width < min_width: |
|
978 width = min_width |
|
979 if height < min_height: |
|
980 height = min_height |
|
981 if element.Size != (width, height): |
|
982 element.SetSize(width, height) |
|
983 element.RefreshModel() |
|
984 |
975 #------------------------------------------------------------------------------- |
985 #------------------------------------------------------------------------------- |
976 # Reset functions |
986 # Reset functions |
977 #------------------------------------------------------------------------------- |
987 #------------------------------------------------------------------------------- |
978 |
988 |
979 # Resets Viewer lists |
989 # Resets Viewer lists |
1382 if input_connector.edge is not None: |
1392 if input_connector.edge is not None: |
1383 connector.SetEdge(input_connector.edge) |
1393 connector.SetEdge(input_connector.edge) |
1384 if not self.CreateWires(connector, instance.id, input_connector.links, remaining_instances, selection): |
1394 if not self.CreateWires(connector, instance.id, input_connector.links, remaining_instances, selection): |
1385 element.RefreshModel() |
1395 element.RefreshModel() |
1386 element.RefreshConnectors() |
1396 element.RefreshConnectors() |
|
1397 self.CorrectElementSize(element, instance.width, instance.height) |
1387 if selection is not None and selection[0].get(instance.id, False): |
1398 if selection is not None and selection[0].get(instance.id, False): |
1388 self.SelectInGroup(element) |
1399 self.SelectInGroup(element) |
1389 |
1400 |
1390 def CreateWires(self, start_connector, id, links, remaining_instances, selection=None): |
1401 def CreateWires(self, start_connector, id, links, remaining_instances, selection=None): |
1391 links_connected = True |
1402 links_connected = True |