Module: wine Branch: master Commit: a3e741fd4c4b8ab76c1be19b3bb5a233729eb3f4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a3e741fd4c4b8ab76c1be19b3b...
Author: Piotr Caban piotr@codeweavers.com Date: Thu Apr 28 18:47:04 2016 +0200
gdi32/enhmfdrv: Fix PolyBezierTo bounding box computation.
Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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; + + 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 = 1; i < count; i++) { + 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)