r17854 by fschmid - PDF-Importer: fixed incorrect calculation of the clipping path in the item optimizer.
scribus-commit
scribus-commit at lists.scribus.net
Mon Nov 5 21:29:53 UTC 2012
Author: fschmid
Date: Mon Nov 5 21:29:53 2012
New Revision: 17854
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17854
Log:
PDF-Importer: fixed incorrect calculation of the clipping path in the item optimizer.
Modified:
trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17854&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Mon Nov 5 21:29:53 2012
@@ -1107,7 +1107,7 @@
}
PageItem *sing = gElements.Items.first();
if ((gElements.Items.count() == 1)
- && (sing->isImageFrame() || sing->isGroup() || sing->isPolygon() || sing->isPolyLine())
+ && (sing->isImageFrame() || sing->isGroup() || sing->isPolygon() || sing->isPolyLine())
&& (ite->patternMask().isEmpty() || sing->patternMask().isEmpty() || (sing->patternMask() == ite->patternMask()))
&& (state->getFillOpacity() == (1.0 - ite->fillTransparency()))
)
@@ -1125,21 +1125,24 @@
}
if (sing->isGroup() || (sing->lineColor() == CommonStrings::None))
{
- if (!sing->isPolyLine())
- {
- QPainterPath input1 = sing->PoLine.toQPainterPath(true);
- if (sing->fillEvenOdd())
- input1.setFillRule(Qt::OddEvenFill);
- else
- input1.setFillRule(Qt::WindingFill);
- QPainterPath input2 = ite->PoLine.toQPainterPath(true);
- if (ite->fillEvenOdd())
- input2.setFillRule(Qt::OddEvenFill);
- else
- input2.setFillRule(Qt::WindingFill);
- QPainterPath result = input1.intersected(input2);
- sing->PoLine.fromQPainterPath(result);
- }
+ double dx = sing->xPos() - ite->xPos();
+ double dy = sing->yPos() - ite->yPos();
+ sing->PoLine.translate(dx, dy);
+ QPainterPath input1 = sing->PoLine.toQPainterPath(true);
+ if (sing->fillEvenOdd())
+ input1.setFillRule(Qt::OddEvenFill);
+ else
+ input1.setFillRule(Qt::WindingFill);
+ QPainterPath input2 = ite->PoLine.toQPainterPath(true);
+ if (ite->fillEvenOdd())
+ input2.setFillRule(Qt::OddEvenFill);
+ else
+ input2.setFillRule(Qt::WindingFill);
+ QPainterPath result = input1.intersected(input2);
+ sing->setXYPos(ite->xPos(), ite->yPos(), true);
+ sing->setWidthHeight(ite->width(), ite->height(), true);
+ sing->PoLine.fromQPainterPath(result);
+ m_doc->AdjustItemSize(sing);
}
delete ite;
}
More information about the scribus-commit
mailing list