editors/Viewer.py
changeset 1644 976ce8c6195d
parent 1619 163d3a883575
child 1647 13d15a1ae899
--- a/editors/Viewer.py	Thu Jan 26 15:38:21 2017 +0300
+++ b/editors/Viewer.py	Thu Jan 26 17:16:54 2017 +0300
@@ -972,6 +972,16 @@
                 return connector.GetEdge()
         return "none"
 
+    def CorrectElementSize(self, element, width, height):
+        min_width, min_height = element.GetMinSize()
+        if width < min_width:
+            width = min_width
+        if height < min_height:
+            height = min_height
+        if element.Size != (width, height):
+            element.SetSize(width, height)
+            element.RefreshModel()
+
 #-------------------------------------------------------------------------------
 #                              Reset functions
 #-------------------------------------------------------------------------------
@@ -1384,6 +1394,7 @@
                 if not self.CreateWires(connector, instance.id, input_connector.links, remaining_instances, selection):
                     element.RefreshModel()
         element.RefreshConnectors()
+        self.CorrectElementSize(element, instance.width, instance.height)
         if selection is not None and selection[0].get(instance.id, False):
             self.SelectInGroup(element)