BasicBlockWidget *tmp, *nextl(NULL), *nextr(NULL);
BasicBlock * tmpblock;
if (block->getNextBlock(0) != 0) {
+ int xshift = 0;
+ if (block->getNextBlock(1) != 0)
+ xshift = 1;
tmpblock = dis->getBasicBlock(block->getNextBlock(0));
tmp = local__add_basic_block(tmpblock, dis,
known_blocks,
- scene, starty, startx+1);
+ scene, starty, startx+xshift);
nextl = tmp;
tmp->addPrevious(widget);
}
}
}
} while (changed);
+
+ for (BasicBlockWidget * widget : widgets) {
+ for (QGraphicsItem * item : widget->collidingItems()) {
+ while (widget->collidesWithItem(item)) {
+ if (widget->scenePos().x() > item->scenePos().x())
+ widget->moveBy(1, 0);
+ else
+ item->moveBy(1, 0);
+ }
+ }
+ }
}