From 6faeea9ddbaa86d1171aa9ee8072b55618926322 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Mon, 21 Dec 2015 10:06:51 +0100 Subject: [PATCH] Corrected pen stroke duplication issue (see below) Presumably due to the change in how pen strokes were saved to file (commit 8ed2e24), pen strokes with pressure levels were badly saved. They were converted to lines instead of polygons, meaning that every time a page was saved or duplicated, the lines would look worse and worse -- and artefacts would appear. This should now be fixed. --- src/adaptors/UBSvgSubsetAdaptor.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 5a38311e..21c57dfe 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -1145,11 +1145,15 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex) } } - if (polygonItem->isNominalLine()) - polygonItemToSvgLine(polygonItem, groupHoldsInfo); - else + UBGraphicsStroke* stroke = dynamic_cast(currentStroke); + + if (stroke && stroke->hasPressure()) polygonItemToSvgPolygon(polygonItem, groupHoldsInfo); + else if (polygonItem->isNominalLine()) + polygonItemToSvgLine(polygonItem, groupHoldsInfo); + + continue; } @@ -2100,7 +2104,6 @@ UBGraphicsMediaItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::videoItemFromSvg() void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* gItem) { - // TODO: check position QStringRef svgTransform = mXmlReader.attributes().value("transform"); QMatrix itemMatrix;