Commit 930a7c6d authored by Claudio Valerio's avatar Claudio Valerio

restored old version of storing strokes

parent 887aff48
...@@ -1043,7 +1043,6 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex) ...@@ -1043,7 +1043,6 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
qSort(items.begin(), items.end(), itemZIndexComp); qSort(items.begin(), items.end(), itemZIndexComp);
UBGraphicsStroke *openStroke = 0; UBGraphicsStroke *openStroke = 0;
int nextStroke = 0;
bool groupHoldsInfo = false; bool groupHoldsInfo = false;
...@@ -1056,32 +1055,12 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex) ...@@ -1056,32 +1055,12 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
if(strokesGroupItem && strokesGroupItem->isVisible()){ if(strokesGroupItem && strokesGroupItem->isVisible()){
// Add the polygons // Add the polygons
//parsing number of polygons into one polygon foreach(QGraphicsItem* item, strokesGroupItem->childItems()){
qDebug() << "parsing stroke number" << nextStroke++;
UBGraphicsPolygonItem *resultPoly = 0;
foreach(QGraphicsItem* item, strokesGroupItem->childItems()) {
UBGraphicsPolygonItem* poly = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item); UBGraphicsPolygonItem* poly = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item);
if (!poly) if(NULL != poly){
continue; polygonItemToSvgPolygon(poly, true);
if (!resultPoly) {
resultPoly = poly;
continue;
}
QPolygonF unitedPolygon = resultPoly->polygon().united(poly->polygon());
resultPoly->setPolygon(unitedPolygon);
items.removeOne(poly); items.removeOne(poly);
} }
if (resultPoly) {
resultPoly->setZValue(strokesGroupItem->zValue());
//Claudio: the painter path simplification remove all the polygons overlap
QPainterPath painterPath;
painterPath.addPolygon(resultPoly->polygon());
painterPath = painterPath.simplified();
resultPoly->setPolygon(painterPath.toFillPolygon());
polygonItemToSvgPolygon(resultPoly, false);
items.removeOne(resultPoly);
} }
} }
......
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