]> git.siccegge.de Git - frida/frida.git/commitdiff
Move each widget exactly once per layout iteration
authorChristoph Egger <christoph@anonymous.siccegge.de>
Sat, 16 May 2015 12:05:10 +0000 (14:05 +0200)
committerChristoph Egger <christoph@anonymous.siccegge.de>
Sat, 16 May 2015 12:05:10 +0000 (14:05 +0200)
BasicBlocks with many incoming edges were pushed downwards faster than
those with less incoming edges resulting in unnatural graph layouting.

Now we move each widget exactly once (move the widget on collissions,
not its successors) keeping the basic ordering by addresses.

The result is not perfect -- there's quite some room for further
improvements though!

Ref 5

src/gui/widgets/CFGScene.cxx

index 4e7428d340f93c822c3ed0d48e907a7136e79742..7e31acbd8dc1af8f05b82c700c10d155b9f191cb 100644 (file)
@@ -75,13 +75,12 @@ void CFGScene::spaceWidgets() {
                        if (NULL != next[0]
                            && (next[0]->getEntry() - widget->getEntry()).y() > 0
                            && (next[0]->getEntry() - out).y() < 50) {
-                               next[0]->moveBy(0, 1);
+                               widget->moveBy(0, -1);
                                changed = true;
-                       }
-                       if (NULL != next[1]
+                       } else if (NULL != next[1]
                            && (next[1]->getEntry() - widget->getEntry()).y() > 0
                            && (next[1]->getEntry() - out).y() < 50) {
-                               next[1]->moveBy(0, 1);
+                               widget->moveBy(0, -1);
                                changed = true;
                        }
                }