diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 9d6203c1..df4530d6 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -938,6 +938,8 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup() if(mStrokesList.contains(id)) shouldSkipSubElements = true; + QStringRef svgTransform = mXmlReader.attributes().value("transform"); + mXmlReader.readNext(); while (!mXmlReader.atEnd()) { @@ -981,6 +983,12 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup() group->destroy(false); } } + + if (!svgTransform.isNull()) { + QMatrix itemMatrix = fromSvgTransform(svgTransform.toString()); + group->setMatrix(itemMatrix); + } + return group; } @@ -1346,6 +1354,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(UBDocumentProxy* proxy, if(curElement.hasAttribute("locked")){ mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri,"locked",curElement.attribute("locked")); } + + if (curElement.hasAttribute("transform")) + mXmlWriter.writeAttribute("transform", curElement.attribute("transform")); + QDomElement curSubElement = curElement.firstChildElement(); while (!curSubElement.isNull()) { if (curSubElement.hasAttribute(aId)) { @@ -1391,6 +1403,8 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro else curGroupElement.setAttribute("locked", xmlFalse); } + + curGroupElement.setAttribute("transform", toSvgTransform(groupItem->sceneMatrix())); curParent->appendChild(curGroupElement); foreach (QGraphicsItem *item, groupItem->childItems()) { QUuid tmpUuid = UBGraphicsScene::getPersonalUuid(item);