diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-04-14 11:40:18 -0400 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-06-04 12:36:28 -0400 |
commit | 7d5f78d2761dbbdfb888d7b4d9504f5e1e1f4601 (patch) | |
tree | 61c4078ca9f1fb2bbe837086d1ff95abf15bfa2e /svx/source/svdraw/svdpdf.cxx | |
parent | 0e66e793546f3c93d6e794c93ddf9e96cb897111 (diff) |
svx: correct the positioning of PDF Paths and the stroke width
Change-Id: I5b150721cc1b61b028f282062c1466ef6a67fcae
(cherry picked from commit 37a40d8025ac70f84937de2b1d0f596d08088cbd)
Diffstat (limited to 'svx/source/svdraw/svdpdf.cxx')
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index b5221a12bb84..59dc26c8da34 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -1283,12 +1283,16 @@ void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int nPageObjectInd continue; } - SAL_WARN("sd.filter", "Got point (" << x << ", " << y << ")"); + SAL_WARN("sd.filter", "Got point (" << x << ", " << y << ") matrix (" << a << ", " << b + << ", " << c << ", " << d << ", " << e << ", " << f + << ')'); x = a * x + c * y + e; y = b * x + d * y + f; const bool bClose = FPDFPathSegment_GetClose(pPathSegment); + if (bClose) + aPoly.setClosed(bClose); // TODO: Review SAL_WARN("sd.filter", "Point corrected (" << x << ", " << y << "): " << (bClose ? "CLOSE" : "OPEN")); Point aPoint = PointsToLogic(x, y); @@ -1338,7 +1342,10 @@ void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int nPageObjectInd float fWidth = 1; FPDFPath_GetStrokeWidth(pPageObject, &fWidth); - mnLineWidth = lcl_ToLogic(lcl_PointToPixel(fWidth)); + SAL_WARN("sd.filter", "Path Stroke Width: " << fWidth); + const double dWidth = fabs(sqrt2(a, c) * fWidth); + SAL_WARN("sd.filter", "Path Stroke Width scaled: " << dWidth); + mnLineWidth = lcl_ToLogic(lcl_PointToPixel(dWidth)); unsigned int nR; unsigned int nG; @@ -1360,7 +1367,6 @@ void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int nPageObjectInd // if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource))) - aPoly.setClosed(true); // TODO: Review SdrPathObj* pPath = new SdrPathObj(*mpModel, OBJ_POLY, basegfx::B2DPolyPolygon(aPoly)); SetAttributes(pPath); InsertObj(pPath, false); |