summaryrefslogtreecommitdiff
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 18:15:53 +0100
commit1531f609673a1fdce18648f1ee0ab04e0432914c (patch)
tree203622ea14b9c0512fcb89db307326b892289995
parentf72580006e9e88d3c374474b3e26678e49952366 (diff)
EMF+: Do not ignore source rectangle of the image to be rendered.
Conflicts: cppcanvas/source/mtfrenderer/emfplus.cxx Change-Id: I4f861c7653c89d8f1ca73696e885f33f7bfc3b06
-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 7b8862ca08e9..aeb52af724b2 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1816,6 +1816,7 @@ namespace cppcanvas
sal_Int32 aCount;
ReadRectangle (rMF, sx, sy, sw, sh);
+ Rectangle aSource(Point(sx, sy), Size(sw, sh));
EMFP_DEBUG (printf ("EMF+ %s source rectangle: %f,%f %fx%f\n", type == EmfPlusRecordTypeDrawImagePoints ? "DrawImagePoints" : "DrawImage", sx, sy, sw, sh));
@@ -1856,6 +1857,7 @@ namespace cppcanvas
if (bValid) {
BitmapEx aBmp( image.graphic.GetBitmapEx () );
+ aBmp.Crop( aSource );
Size aSize( aBmp.GetSizePixel() );
EMFP_DEBUG (printf ("EMF+ bitmap size: %ldx%ld\n", aSize.Width(), aSize.Height()));