Alexandre Julliard : gdi32: Add a helper function to start a new path stroke.
Alexandre Julliard
julliard at winehq.org
Thu Oct 27 13:30:11 CDT 2011
Module: wine
Branch: master
Commit: 364e216462620b1bf15f472abb1833346a9f6314
URL: http://source.winehq.org/git/wine.git/?a=commit;h=364e216462620b1bf15f472abb1833346a9f6314
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Oct 26 20:02:10 2011 +0200
gdi32: Add a helper function to start a new path stroke.
---
dlls/gdi32/path.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index 11be17c..8ddff53 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -230,6 +230,18 @@ static BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags)
return TRUE;
}
+/* start a new path stroke if necessary */
+static BOOL start_new_stroke( struct path_physdev *physdev )
+{
+ POINT pos;
+
+ if (!physdev->path->newStroke) return TRUE;
+ physdev->path->newStroke = FALSE;
+ GetCurrentPositionEx( physdev->dev.hdc, &pos );
+ LPtoDP( physdev->dev.hdc, &pos, 1 );
+ return PATH_AddEntry( physdev->path, &pos, PT_MOVETO );
+}
+
/* PATH_AssignGdiPath
*
* Copies the GdiPath structure "pPathSrc" to "pPathDest". A deep copy is
@@ -902,24 +914,15 @@ static BOOL pathdrv_MoveTo( PHYSDEV dev, INT x, INT y )
static BOOL pathdrv_LineTo( PHYSDEV dev, INT x, INT y )
{
struct path_physdev *physdev = get_path_physdev( dev );
- POINT point, pointCurPos;
+ POINT point;
/* Convert point to device coordinates */
point.x = x;
point.y = y;
LPtoDP( dev->hdc, &point, 1 );
- /* Add a PT_MOVETO if necessary */
- if(physdev->path->newStroke)
- {
- physdev->path->newStroke = FALSE;
- GetCurrentPositionEx( dev->hdc, &pointCurPos );
- LPtoDP( dev->hdc, &pointCurPos, 1 );
- if(!PATH_AddEntry(physdev->path, &pointCurPos, PT_MOVETO))
- return FALSE;
- }
+ if (!start_new_stroke( physdev )) return FALSE;
- /* Add a PT_LINETO entry */
return PATH_AddEntry(physdev->path, &point, PT_LINETO);
}
More information about the wine-cvs
mailing list