Commit d6503534 authored by Craig Watson's avatar Craig Watson

Fixed duplication of groups

Previously, duplication did not copy the transformation matrices of group
members correctly. This made grouped objects move away when saving and
re-opening a document.
This should now be fixed.
parent 76636f73
......@@ -1114,11 +1114,11 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const
UBGraphicsGroupContainerItem* groupCloned = group->deepCopyNoChildDuplication();
groupCloned->resetMatrix();
groupCloned->resetTransform();
groupCloned->setMatrix(group->matrix());
groupCloned->setTransform(group->transform());
foreach(QGraphicsItem* eachItem ,group->childItems()){
QGraphicsItem* copiedChild = dynamic_cast<QGraphicsItem*>(dynamic_cast<UBItem*>(eachItem)->deepCopy());
copiedChild->resetTransform();
copiedChild->resetMatrix();
copiedChild->setMatrix(eachItem->sceneMatrix());
copy->addItem(copiedChild);
groupCloned->addToGroup(copiedChild);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment