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.
preferencesAboutTextFull
Craig Watson 9 years ago
parent 76636f73d7
commit d6503534db
  1. 6
      src/domain/UBGraphicsScene.cpp

@ -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);
}

Loading…
Cancel
Save