Commit 14849cf5 authored by Craig Watson's avatar Craig Watson

Fix saving of groups' positions

Previously, only transforms were saved -- not positions (which are set
if a group is moved by dragging it directly; if dragged by its frame,
its transform is updated instead).

Issue observed was that a group that had been moved would lose its new
position when the document was saved then loaded. (All other transforms
were kept, however).

Now, when duplicating a group before saving a document, position is
included in the group's transform.
parent 1fd25456
......@@ -1178,6 +1178,7 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const
UBGraphicsGroupContainerItem* groupCloned = group->deepCopyNoChildDuplication();
groupCloned->resetMatrix();
groupCloned->resetTransform();
groupCloned->setPos(0, 0);
bool locked = groupCloned->Delegate()->isLocked();
foreach(QGraphicsItem* eachItem ,group->childItems()){
......@@ -1191,7 +1192,8 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const
copy->addItem(groupCloned);
groupCloned->setMatrix(group->matrix());
groupCloned->setTransform(group->transform());
groupCloned->setTransform(QTransform::fromTranslate(group->pos().x(), group->pos().y()));
groupCloned->setTransform(group->transform(), true);
}
if (ubItem && !stroke && !group && item->isVisible())
......
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