eric6/Graphics/UMLClassDiagramBuilder.py

changeset 8270
6ba3564b7161
parent 8257
28146736bbfc
child 8273
698ae46f40a4
child 8277
ea734702ae94
--- a/eric6/Graphics/UMLClassDiagramBuilder.py	Thu Apr 29 17:39:17 2021 +0200
+++ b/eric6/Graphics/UMLClassDiagramBuilder.py	Fri Apr 30 19:54:20 2021 +0200
@@ -200,8 +200,8 @@
         sceneRect = self.umlView.sceneRect()
         width += 50.0
         height += 50.0
-        swidth = width < sceneRect.width() and sceneRect.width() or width
-        sheight = height < sceneRect.height() and sceneRect.height() or height
+        swidth = sceneRect.width() if width < sceneRect.width() else width
+        sheight = sceneRect.height() if height < sceneRect.height() else height
         self.umlView.setSceneSize(swidth, sheight)
         
         # distribute each generation across the width and the
@@ -273,13 +273,13 @@
         
         @param routes list of relationsships
         """
-        from .AssociationItem import AssociationItem, Generalisation
+        from .AssociationItem import AssociationItem, AssociationType
         for route in routes:
             if len(route) > 1:
                 assoc = AssociationItem(
                     self.__getCurrentShape(route[1]),
                     self.__getCurrentShape(route[0]),
-                    Generalisation,
+                    AssociationType.GENERALISATION,
                     topToBottom=True,
                     colors=self.umlView.getDrawingColors())
                 self.scene.addItem(assoc)

eric ide

mercurial