From: Piotr Caban Subject: [PATCH 09/11] gdi32/enhmfdrv: Don't update document bounds in RoundRect within a path Message-Id: Date: Thu, 28 Apr 2016 18:48:46 +0200 Signed-off-by: Piotr Caban --- dlls/gdi32/enhmfdrv/graphics.c | 4 +++- dlls/gdi32/tests/metafile.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c index 5b1b0a4..98121e5 100644 --- a/dlls/gdi32/enhmfdrv/graphics.c +++ b/dlls/gdi32/enhmfdrv/graphics.c @@ -288,6 +288,7 @@ BOOL EMFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom) BOOL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height ) { + EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev; EMRROUNDRECT emr; INT temp; @@ -310,7 +311,8 @@ BOOL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, emr.szlCorner.cx = ell_width; emr.szlCorner.cy = ell_height; - EMFDRV_UpdateBBox( dev, &emr.rclBox ); + if(!physDev->path) + EMFDRV_UpdateBBox( dev, &emr.rclBox ); return EMFDRV_WriteRecord( dev, &emr.emr ); } diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 3e989c4..bdc2a0a 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -3585,7 +3585,7 @@ static const unsigned char EMF_PATH_BITS[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0xff, 0xff, 0xea, 0xff, 0xff, 0xff, 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00, - 0x88, 0x01, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0xa8, 0x01, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x3e, 0x04, 0x00, 0x00, @@ -3624,7 +3624,11 @@ static const unsigned char EMF_PATH_BITS[] = 0x15, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, - 0x13, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, + 0x13, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 @@ -3657,10 +3661,11 @@ static void test_emf_GetPath(void) Chord(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21); Pie(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21); Ellipse(hdcMetafile, 10, 10, 20, 20); + RoundRect(hdcMetafile, 10, 10, 20, 20, 3, 5); EndPath(hdcMetafile); size = GetPath(hdcMetafile, NULL, NULL, 0); - todo_wine ok( size == 53, "GetPath returned %d.\n", size); + todo_wine ok( size == 69, "GetPath returned %d.\n", size); hemf = CloseEnhMetaFile(hdcMetafile); ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());