summaryrefslogtreecommitdiffstats
path: root/drawinglayer/source/tools/emfphelperdata.cxx
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2019-01-15 15:11:28 +0100
committerBartosz Kosiorek <gang65@poczta.onet.pl>2019-01-17 07:55:29 +0100
commite3ccc09417731e61d3d35ed4cc1a7436e05f5325 (patch)
treedcb792e062671620dcfca9dc8fc33ec8e1482b57 /drawinglayer/source/tools/emfphelperdata.cxx
parentconvert ScChangeTrackMsgType to scoped enum (diff)
downloadcore-e3ccc09417731e61d3d35ed4cc1a7436e05f5325.tar.gz
core-e3ccc09417731e61d3d35ed4cc1a7436e05f5325.zip
tdf#122557 EMF+ Implement proper rotation support of DrawImage
Change-Id: I2c32a47fac06b2026d61a0f369e6d569c9f57502 Reviewed-on: https://gerrit.libreoffice.org/66392 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'drawinglayer/source/tools/emfphelperdata.cxx')
-rw-r--r--drawinglayer/source/tools/emfphelperdata.cxx21
1 files changed, 8 insertions, 13 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 5c86d69f1282..03f23451c492 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -36,6 +36,7 @@
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
@@ -336,12 +337,6 @@ namespace emfplushelper
return maMapTransform * ::basegfx::B2DPoint(ix, iy);
}
- ::basegfx::B2DSize EmfPlusHelperData::MapSize(double iwidth, double iheight) const
- {
- // map in one step using complete MapTransform (see mappingChanged)
- return maMapTransform * ::basegfx::B2DSize(iwidth, iheight);
- }
-
Color EmfPlusHelperData::EMFPGetBrushColorOrARGBColor(const sal_uInt16 flags, const sal_uInt32 brushIndexOrColor) const {
Color color;
if (flags & 0x8000) // we use a color
@@ -1224,11 +1219,10 @@ namespace emfplushelper
ReadPoint(rMS, x2, y2, flags); // upper-right
ReadPoint(rMS, x3, y3, flags); // lower-left
- SAL_INFO("drawinglayer", "EMF+\t destination points: " << x1 << "," << y1 << " " << x2 << "," << y2 << " " << x3 << "," << y3);
- SAL_INFO("drawinglayer", "EMF+\t destination rectangle: " << x1 << "," << y1 << " " << x2 - x1 << "x" << y3 - y1);
+ SAL_INFO("drawinglayer", "EMF+\t destination points: P1:" << x1 << "," << y1 << " P2:" << x2 << "," << y2 << " P3:" << x3 << "," << y3);
- aDstPoint = Map(x1, y1);
- aDstSize = MapSize(x2 - x1, y3 - y1);
+ aDstPoint = ::basegfx::B2DPoint(x1, y1);
+ aDstSize = ::basegfx::B2DSize(x2 - x1, y3 - y1);
}
else
{
@@ -1241,12 +1235,12 @@ namespace emfplushelper
float dx, dy, dw, dh;
ReadRectangle(rMS, dx, dy, dw, dh, bool(flags & 0x4000));
SAL_INFO("drawinglayer", "EMF+\t destination rectangle: " << dx << "," << dy << " " << dw << "x" << dh);
- aDstPoint = Map(dx, dy);
- aDstSize = MapSize(dw, dh);
+ aDstPoint = ::basegfx::B2DPoint(dx, dy);
+ aDstSize = ::basegfx::B2DSize(dw, dh);
}
// create correct transform matrix
- basegfx::B2DHomMatrix aTransformMatrix = basegfx::utils::createScaleTranslateB2DHomMatrix(
+ const basegfx::B2DHomMatrix aTransformMatrix = maMapTransform * basegfx::utils::createScaleTranslateB2DHomMatrix(
aDstSize.getX(),
aDstSize.getY(),
aDstPoint.getX(),
@@ -1266,6 +1260,7 @@ namespace emfplushelper
else
{
SAL_WARN("drawinglayer", "EMF+\t warning: empty bitmap");
+ break;
}
}
else if (image.type == ImageDataTypeMetafile)