diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-04-10 00:31:00 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-04-13 18:31:55 +0200 |
commit | fe62003caabf7665d41085c5d16f177f8186fce4 (patch) | |
tree | caba5e52e2653e639e6b65fdc363c7ffe0ce9bef /cppcanvas | |
parent | 572663345531f8485b783f7d80bf51836550b8c4 (diff) |
tdf#106084 EMF+ Add support for EmfPlusScaleWorldTransform record
The EmfPlusScaleWorldTransform record performs a scaling on the current world space transform.
Change-Id: I03717b28a88d574d597174c6ca3446f937c96a15
Reviewed-on: https://gerrit.libreoffice.org/36320
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'cppcanvas')
-rw-r--r-- | cppcanvas/source/mtfrenderer/emfplus.cxx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 924e5a220ff4..f1e2f4f7f401 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -103,7 +103,7 @@ namespace #define EmfPlusRecordTypeResetWorldTransform 0x402B #define EmfPlusRecordTypeMultiplyWorldTransform 0x402C #define EmfPlusRecordTypeTranslateWorldTransform 0x402D -//TODO EmfPlusRecordTypeScaleWorldTransform 0x402E +#define EmfPlusRecordTypeScaleWorldTransform 0x402E //TODO EmfPlusRecordTypeRotateWorldTransform 0x402F #define EmfPlusRecordTypeSetPageTransform 0x4030 //TODO EmfPlusRecordTypeResetClip 0x4031 @@ -175,6 +175,7 @@ const char* emfTypeToName(sal_uInt16 type) case EmfPlusRecordTypeResetWorldTransform: return "EmfPlusRecordTypeResetWorldTransform"; case EmfPlusRecordTypeMultiplyWorldTransform: return "EmfPlusRecordTypeMultiplyWorldTransform"; case EmfPlusRecordTypeTranslateWorldTransform: return "EmfPlusRecordTypeTranslateWorldTransform"; + case EmfPlusRecordTypeScaleWorldTransform: return "EmfPlusRecordTypeScaleWorldTransform"; case EmfPlusRecordTypeSetPageTransform: return "EmfPlusRecordTypeSetPageTransform"; case EmfPlusRecordTypeSetClipRect: return "EmfPlusRecordTypeSetClipRect"; case EmfPlusRecordTypeSetClipPath: return "EmfPlusRecordTypeSetClipPath"; @@ -1420,6 +1421,29 @@ namespace cppcanvas "EMF+\t dx: " << aWorldTransform.eDx << ", dy: " << aWorldTransform.eDy); break; } + case EmfPlusRecordTypeScaleWorldTransform: + { + XForm transform = XForm(); + rMF.ReadFloat( transform.eM11 ).ReadFloat( transform.eM22 ); + SAL_INFO("cppcanvas.emf", "EMF+ ScaleWorldTransform Sx: " << transform.eM11 << " Sy: " << transform.eM22); + + SAL_INFO("cppcanvas.emf", + "EMF+\t m11: " << aWorldTransform.eM11 << ", m12: " << aWorldTransform.eM12 << + "EMF+\t m21: " << aWorldTransform.eM21 << ", m22: " << aWorldTransform.eM22 << + "EMF+\t dx: " << aWorldTransform.eDx << ", dy: " << aWorldTransform.eDy); + + if (flags & 0x2000) // post multiply + aWorldTransform.Multiply (transform); + else { // pre multiply + transform.Multiply (aWorldTransform); + aWorldTransform.Set (transform); + } + SAL_INFO("cppcanvas.emf", + "EMF+\t m11: " << aWorldTransform.eM11 << ", m12: " << aWorldTransform.eM12 << + "EMF+\t m21: " << aWorldTransform.eM21 << ", m22: " << aWorldTransform.eM22 << + "EMF+\t dx: " << aWorldTransform.eDx << ", dy: " << aWorldTransform.eDy); + break; + } case EmfPlusRecordTypeSetClipRect: { int combineMode = (flags >> 8) & 0xf; |