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@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
This commit is contained in:
Bartosz Kosiorek
2017-04-27 01:52:00 +02:00
parent e005b0a37f
commit e31c535b57

View File

@@ -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: