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:
@@ -771,8 +771,6 @@ namespace cppcanvas
|
|||||||
EMFPStringFormat *stringFormat;
|
EMFPStringFormat *stringFormat;
|
||||||
aObjects [index] = stringFormat = new EMFPStringFormat();
|
aObjects [index] = stringFormat = new EMFPStringFormat();
|
||||||
stringFormat->Read (rObjectStream);
|
stringFormat->Read (rObjectStream);
|
||||||
|
|
||||||
SAL_INFO("cppcanvas.emf", "EMF+\t Object type 'string format' not yet implemented");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EmfPlusObjectTypeImageAttributes:
|
case EmfPlusObjectTypeImageAttributes:
|
||||||
@@ -1285,6 +1283,7 @@ namespace cppcanvas
|
|||||||
LanguageTag aLanguageTag( static_cast< LanguageType >( stringFormat->language ) );
|
LanguageTag aLanguageTag( static_cast< LanguageType >( stringFormat->language ) );
|
||||||
aFontRequest.Locale = aLanguageTag.getLocale( false );
|
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 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);
|
double cellSize = setFont (aFontRequest, flags & 0xff, rFactoryParms, rState);
|
||||||
rState.textColor = COLOR( brushId );
|
rState.textColor = COLOR( brushId );
|
||||||
@@ -1335,17 +1334,11 @@ namespace cppcanvas
|
|||||||
|
|
||||||
if (flags != UnitTypePixel)
|
if (flags != UnitTypePixel)
|
||||||
SAL_WARN("cppcanvas.emf", "EMF+\t TODO Only UnitTypePixel is supported. ");
|
SAL_WARN("cppcanvas.emf", "EMF+\t TODO Only UnitTypePixel is supported. ");
|
||||||
|
else
|
||||||
XForm transform = XForm();
|
{
|
||||||
transform.eM11 = fPageScale;
|
nMmX *= fPageScale;
|
||||||
transform.eM22 = fPageScale;
|
nMmY *= 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);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EmfPlusRecordTypeSetRenderingOrigin:
|
case EmfPlusRecordTypeSetRenderingOrigin:
|
||||||
|
Reference in New Issue
Block a user