- //cout << "block abs. pos: " << absPos.x() << "," << absPos.y() << " | ";
- //cout << "block current. pos: " << currentPosition.x() << "," << currentPosition.y() << " | ";
-/*
- if (absPos.x()+gapX < 0) {
- gapX = -absPos.x();
+ bool canMove = true;
+ if (refBlock->isTopGroupBlock()) {
+ QRectF rectGroup = boundingRectInScene();
+ rectGroup.moveTo(rectGroup.x()+gapX,rectGroup.y()+gapY);
+ foreach(SourceItem* source, getScene()->getSourceItems()) {
+ QRectF rectSource = source->boundingRectInScene();
+ if (rectGroup.intersects(rectSource)) canMove = false;
+ }