[Libreoffice-commits] core.git: cppcanvas/source
Bartosz Kosiorek
gang65 at poczta.onet.pl
Thu Apr 27 14:26:23 UTC 2017
cppcanvas/source/mtfrenderer/emfplus.cxx | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
New commits:
commit e31c535b574fc37e6961c5ce7bd507a30e6abff1
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
Date: Thu Apr 27 01:52:00 2017 +0200
tdf#47243 tdf#39327 tdf#103639 Proper scaling of SetPageTransform
The EmfPlusSetPageTransform record specifies scaling factors and units for converting page space
coordinates to device space coordinates.
In previous implementation I made scaling after translating page scaling.
For some images it was working correctly (if there wasn't translating).
WIth this commit I fixed this issue.
Change-Id: I1e9e78ecdab663328f86a960d8547ad0a7fc1314
Reviewed-on: https://gerrit.libreoffice.org/37010
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 631dde57d687..bd13102eb6a6 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -771,8 +771,6 @@ namespace cppcanvas
EMFPStringFormat *stringFormat;
aObjects [index] = stringFormat = new EMFPStringFormat();
stringFormat->Read (rObjectStream);
-
- SAL_INFO("cppcanvas.emf", "EMF+\t Object type 'string format' not yet implemented");
break;
}
case EmfPlusObjectTypeImageAttributes:
@@ -1285,6 +1283,7 @@ namespace cppcanvas
LanguageTag aLanguageTag( static_cast< LanguageType >( stringFormat->language ) );
aFontRequest.Locale = aLanguageTag.getLocale( false );
SAL_INFO("cppcanvas.emf", "EMF+\t\t Font locale, Country:" << aLanguageTag.getCountry() <<" Language:" << aLanguageTag.getLanguage() );
+ SAL_INFO("cppcanvas.emf", "EMF+\t\t TODO Use all string formatting attributes during drawing");
double cellSize = setFont (aFontRequest, flags & 0xff, rFactoryParms, rState);
rState.textColor = COLOR( brushId );
@@ -1335,17 +1334,11 @@ namespace cppcanvas
if (flags != UnitTypePixel)
SAL_WARN("cppcanvas.emf", "EMF+\t TODO Only UnitTypePixel is supported. ");
-
- XForm transform = XForm();
- transform.eM11 = fPageScale;
- transform.eM22 = fPageScale;
-
- SAL_INFO("cppcanvas.emf",
- "EMF+\t m11: " << aBaseTransform.eM11 << ", m12: " << aBaseTransform.eM12 <<
- "EMF+\t m21: " << aBaseTransform.eM21 << ", m22: " << aBaseTransform.eM22 <<
- "EMF+\t dx: " << aBaseTransform.eDx << ", dy: " << aBaseTransform.eDy);
-
- aBaseTransform.Multiply (transform);
+ else
+ {
+ nMmX *= fPageScale;
+ nMmY *= fPageScale;
+ }
}
break;
case EmfPlusRecordTypeSetRenderingOrigin:
More information about the Libreoffice-commits
mailing list