From: Piotr Caban Subject: [PATCH 01/11] gdi32/enhmfdrv: Fix PolyBezierTo bounding box computation Message-Id: <34b8c19d-e135-8c54-f3e5-08c7b91fc042@codeweavers.com> Date: Thu, 28 Apr 2016 18:47:04 +0200 This series supersedes patches 121826 and 121827. Don't update document bounds in all functions that can be used inside path. Signed-off-by: Piotr Caban --- dlls/gdi32/enhmfdrv/graphics.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c index ae05378..e5553e0 100644 --- a/dlls/gdi32/enhmfdrv/graphics.c +++ b/dlls/gdi32/enhmfdrv/graphics.c @@ -348,10 +348,22 @@ EMFDRV_Polylinegon( PHYSDEV dev, const POINT* pt, INT count, DWORD iType ) emr->emr.iType = iType; emr->emr.nSize = size; - emr->rclBounds.left = emr->rclBounds.right = pt[0].x; - emr->rclBounds.top = emr->rclBounds.bottom = pt[0].y; + if(iType == EMR_POLYBEZIERTO) { + POINT cur_pt; - for(i = 1; i < count; i++) { + GetCurrentPositionEx( dev->hdc, &cur_pt ); + emr->rclBounds.left = emr->rclBounds.right = cur_pt.x; + emr->rclBounds.top = emr->rclBounds.bottom = cur_pt.y; + i = 0; + } + else + { + emr->rclBounds.left = emr->rclBounds.right = pt[0].x; + emr->rclBounds.top = emr->rclBounds.bottom = pt[0].y; + i = 1; + } + + for(; i < count; i++) { if(pt[i].x < emr->rclBounds.left) emr->rclBounds.left = pt[i].x; else if(pt[i].x > emr->rclBounds.right) @@ -402,10 +414,22 @@ EMFDRV_Polylinegon16( PHYSDEV dev, const POINT* pt, INT count, DWORD iType ) emr->emr.iType = iType; emr->emr.nSize = size; - emr->rclBounds.left = emr->rclBounds.right = pt[0].x; - emr->rclBounds.top = emr->rclBounds.bottom = pt[0].y; + if(iType == EMR_POLYBEZIERTO16) { + POINT cur_pt; - for(i = 1; i < count; i++) { + GetCurrentPositionEx( dev->hdc, &cur_pt ); + emr->rclBounds.left = emr->rclBounds.right = cur_pt.x; + emr->rclBounds.top = emr->rclBounds.bottom = cur_pt.y; + i = 0; + } + else + { + emr->rclBounds.left = emr->rclBounds.right = pt[0].x; + emr->rclBounds.top = emr->rclBounds.bottom = pt[0].y; + i = 1; + } + + for(; i < count; i++) { if(pt[i].x < emr->rclBounds.left) emr->rclBounds.left = pt[i].x; else if(pt[i].x > emr->rclBounds.right)