From de429ddee0e539f5ac4bd3523d6183a4869f43d0 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Sun, 21 Oct 2012 14:20:46 +0200 Subject: [PATCH] fixed the transfomation persistance for polygons --- src/adaptors/UBSvgSubsetAdaptor.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 8392dc68..544a2128 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -1693,6 +1693,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::polygonItemToSvgPolygon(UBGraphicsPo QString points = pointsToSvgPointsAttribute(polygon); mXmlWriter.writeAttribute("points", points); + mXmlWriter.writeAttribute("transform",toSvgTransform(polygonItem->sceneMatrix())); mXmlWriter.writeAttribute("fill", polygonItem->brush().color().name()); qreal alpha = polygonItem->brush().color().alphaF(); @@ -1781,6 +1782,16 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol polygonItem->setPolygon(polygon); + QStringRef svgTransform = mXmlReader.attributes().value("transform"); + + QMatrix itemMatrix; + + if (!svgTransform.isNull()) + { + itemMatrix = fromSvgTransform(svgTransform.toString()); + polygonItem->setMatrix(itemMatrix); + } + QStringRef svgFill = mXmlReader.attributes().value("fill"); QColor brushColor = pDefaultColor;