eric6/Graphics/PackageDiagramBuilder.py

changeset 8286
62ae22eae123
parent 8277
ea734702ae94
child 8289
871b40c5a77a
diff -r 1816b622aef2 -r 62ae22eae123 eric6/Graphics/PackageDiagramBuilder.py
--- a/eric6/Graphics/PackageDiagramBuilder.py	Sun May 02 18:16:54 2021 +0200
+++ b/eric6/Graphics/PackageDiagramBuilder.py	Mon May 03 19:42:27 2021 +0200
@@ -243,7 +243,7 @@
             todo = [module.createHierarchy()]
             while todo:
                 hierarchy = todo[0]
-                for className in list(hierarchy.keys()):
+                for className in hierarchy:
                     cw = self.__getCurrentShape(className)
                     if not cw and className.find('.') >= 0:
                         cw = self.__getCurrentShape(className.split('.')[-1])
@@ -335,7 +335,7 @@
             # store generation info
             widths.append(currentWidth)
             heights.append(currentHeight)
-            
+        
         # add in some whitespace
         width *= whiteSpaceFactor
         height = height * whiteSpaceFactor - 20
@@ -344,8 +344,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

eric ide

mercurial