diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-04-27 01:52:00 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-04-27 16:25:50 +0200 |
commit | e31c535b574fc37e6961c5ce7bd507a30e6abff1 (patch) | |
tree | 40e0ff87bcbd6836473c3323aaa98c1f3fe8001d | |
parent | e005b0a37feedffafc3fb89c61f054b692dc0c43 (diff) |
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@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
-rw-r--r-- | cppcanvas/source/mtfrenderer/emfplus.cxx | 19 |
1 files changed, 6 insertions, 13 deletions
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: |