Piotr Caban : gdi32/enhmfdrv: Don' t update document bounds in Ellipse within a path.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 29 11:05:58 CDT 2016


Module: wine
Branch: master
Commit: 661bc10bfed0d515c837be35b7954fe3f8c58223
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=661bc10bfed0d515c837be35b7954fe3f8c58223

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Apr 28 18:48:32 2016 +0200

gdi32/enhmfdrv: Don't update document bounds in Ellipse within a path.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/enhmfdrv/graphics.c |  4 +++-
 dlls/gdi32/tests/metafile.c    | 10 +++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c
index 19cc423..5b1b0a4 100644
--- a/dlls/gdi32/enhmfdrv/graphics.c
+++ b/dlls/gdi32/enhmfdrv/graphics.c
@@ -221,6 +221,7 @@ BOOL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
  */
 BOOL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
 {
+    EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev;
     EMRELLIPSE emr;
     INT temp;
 
@@ -243,7 +244,8 @@ BOOL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
     emr.rclBox.right  = right;
     emr.rclBox.bottom = bottom;
 
-    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 f8ced6e..3e989c4 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,
-    0x70, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
+    0x88, 0x01, 0x00, 0x00, 0x0e, 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,
@@ -3621,7 +3621,10 @@ static const unsigned char EMF_PATH_BITS[] =
     0x15, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
     0x1c, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
     0x1d, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
-    0x15, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
+    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,
     0x08, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
     0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
@@ -3653,10 +3656,11 @@ static void test_emf_GetPath(void)
     Arc(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21);
     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);
     EndPath(hdcMetafile);
 
     size = GetPath(hdcMetafile, NULL, NULL, 0);
-    todo_wine ok( size == 40, "GetPath returned %d.\n", size);
+    todo_wine ok( size == 53, "GetPath returned %d.\n", size);
 
     hemf = CloseEnhMetaFile(hdcMetafile);
     ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());




More information about the wine-cvs mailing list