Piotr Caban : gdi32/enhmfdrv: Don't update document bounds in Arc/Chord/ Pie within a path.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Apr 29 11:05:58 CDT 2016
Module: wine
Branch: master
Commit: c36f3653295110f5d4f92a3db7be10f322448c1f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c36f3653295110f5d4f92a3db7be10f322448c1f
Author: Piotr Caban <piotr at codeweavers.com>
Date: Thu Apr 28 18:48:18 2016 +0200
gdi32/enhmfdrv: Don't update document bounds in Arc/Chord/Pie 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 | 34 ++++++++++++++++++++++++++--------
2 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c
index a5918a9..19cc423 100644
--- a/dlls/gdi32/enhmfdrv/graphics.c
+++ b/dlls/gdi32/enhmfdrv/graphics.c
@@ -87,6 +87,7 @@ static BOOL
EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend, DWORD iType )
{
+ EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev;
INT temp, xCentre, yCentre, i;
double angleStart, angleEnd;
double xinterStart, yinterStart, xinterEnd, yinterEnd;
@@ -178,7 +179,8 @@ EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
}
if(!EMFDRV_WriteRecord( dev, &emr.emr ))
return FALSE;
- EMFDRV_UpdateBBox( dev, &bounds );
+ if(!physDev->path)
+ EMFDRV_UpdateBBox( dev, &bounds );
return TRUE;
}
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index b71249f..f8ced6e 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -3583,16 +3583,16 @@ static const unsigned char EMF_PATH_BITS[] =
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xe6, 0xff, 0xff, 0xff, 0xe6, 0xff, 0xff, 0xff,
+ 0xef, 0xff, 0xff, 0xff, 0xea, 0xff, 0xff, 0xff,
0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
- 0xf8, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
+ 0x70, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x80, 0x07, 0x00, 0x00, 0xd3, 0x03, 0x00, 0x00,
- 0xfc, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0x3e, 0x04, 0x00, 0x00,
+ 0x40, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
- 0xd3, 0xf3, 0x03, 0x00, 0x3b, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x04, 0x00,
+ 0x80, 0xa9, 0x03, 0x00, 0x3b, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00,
0x32, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00,
@@ -3606,7 +3606,22 @@ static const unsigned char EMF_PATH_BITS[] =
0x32, 0x00, 0x00, 0x00, 0x2b, 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, 0x2d, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
+ 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, 0x2e, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
+ 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, 0x2f, 0x00, 0x00, 0x00,
+ 0x28, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
+ 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,
0x08, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
@@ -3635,10 +3650,13 @@ static void test_emf_GetPath(void)
ret = LineTo(hdcMetafile, 50, 50);
ok( ret, "LineTo error %d.\n", GetLastError());
Rectangle(hdcMetafile, 10, 10, 20, 20);
+ 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);
EndPath(hdcMetafile);
size = GetPath(hdcMetafile, NULL, NULL, 0);
- todo_wine ok( size == 9, "GetPath returned %d.\n", size);
+ todo_wine ok( size == 40, "GetPath returned %d.\n", size);
hemf = CloseEnhMetaFile(hdcMetafile);
ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());
More information about the wine-cvs
mailing list