summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2013-12-04 16:57:34 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2013-12-04 17:48:09 +0100
commitfaf50efc7df5687b2983990078d42d8b4a882bb5 (patch)
treee530ceee82b4e5dd937e691ac0fc0651f2165c43 /cppcanvas
parent0e209b7a7bbd234d77f617e70cc4971d4f0dbb41 (diff)
EMF+: Do not ignore source rectangle of the image to be rendered.
Change-Id: I4f861c7653c89d8f1ca73696e885f33f7bfc3b06
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index e7fa98495d5b..bbf41748bbb9 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1828,6 +1828,7 @@ namespace cppcanvas
sal_Int32 aCount;
ReadRectangle (rMF, sx, sy, sw, sh);
+ Rectangle aSource(Point(sx, sy), Size(sw, sh));
SAL_INFO("cppcanvas.emf", "EMF+ " << (type == EmfPlusRecordTypeDrawImagePoints ? "DrawImagePoints" : "DrawImage") << " source rectangle: " << sx << "," << sy << " " << sw << "x" << sh);
@@ -1868,6 +1869,7 @@ namespace cppcanvas
if (bValid) {
BitmapEx aBmp( image.graphic.GetBitmapEx () );
+ aBmp.Crop( aSource );
Size aSize( aBmp.GetSizePixel() );
SAL_INFO("cppcanvas.emf", "EMF+ bitmap size: " << aSize.Width() << "x" << aSize.Height());