X-Git-Url: https://git.siccegge.de//index.cgi?a=blobdiff_plain;f=src%2Fgui%2Fwidgets%2FCFGScene.cxx;h=c40e2498494a85a403156feb0c1d83864da93d5e;hb=c81c0d3dba088b302187d7862a62ca88d2306e24;hp=4e7428d340f93c822c3ed0d48e907a7136e79742;hpb=4bcd18ed3dc3450d014351f5b27d1c7d1596601c;p=frida%2Ffrida.git diff --git a/src/gui/widgets/CFGScene.cxx b/src/gui/widgets/CFGScene.cxx index 4e7428d..c40e249 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; } } @@ -108,3 +107,15 @@ void CFGScene::spaceWidgets() { } } } + +void CFGScene::highlightBlock(BasicBlockWidget* block) { + QGraphicsView* view = *(views().begin()); + if (highlightedBlock) { + highlightedBlock->setColor(highlightedBlock->defaultColor); + update(highlightedBlock->boundingRect()); + } + highlightedBlock = block; + view->centerOn(block); + block->setColor(block->highlightColor); + update(block->boundingRect()); +}