From: Christoph Egger Date: Sat, 16 May 2015 12:05:10 +0000 (+0200) Subject: Move each widget exactly once per layout iteration X-Git-Tag: v0.2~28 X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=937eb556b5c04d6379e0ffde2e13c3065e053a3a;p=frida%2Ffrida.git Move each widget exactly once per layout iteration 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 --- diff --git a/src/gui/widgets/CFGScene.cxx b/src/gui/widgets/CFGScene.cxx index 4e7428d..7e31acb 100644 --- a/src/gui/widgets/CFGScene.cxx +++ b/src/gui/widgets/CFGScene.cxx @@ -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; } }