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;
}
}
}
}
}
+
+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());
+}