summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-04-14 11:40:18 -0400
committerJan Holesovsky <kendy@collabora.com>2018-05-22 12:17:15 +0200
commit37a40d8025ac70f84937de2b1d0f596d08088cbd (patch)
tree508f623f97b27805e9d4dc5d1c2a797f4e0d543f /svx
parentd057cf3d9184cc5d96af9c957411911f5e788f4d (diff)
svx: correct the positioning of PDF Paths and the stroke width
Change-Id: I5b150721cc1b61b028f282062c1466ef6a67fcae
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdpdf.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index 2735ae4c94a1..8481093d6d63 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -1276,12 +1276,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);
@@ -1331,7 +1335,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;
@@ -1353,7 +1360,6 @@ void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int nPageObjectInd
// if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource)))
- aPoly.setClosed(true); // TODO: Review
SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aPoly));
SetAttributes(pPath);
InsertObj(pPath, false);