Author: jimtabor
Date: Fri Nov 10 15:50:34 2006
New Revision: 24713
URL:
http://svn.reactos.org/svn/reactos?rev=24713&view=rev
Log:
Sync up PATH_Arc and PATH_Ellipse with Wine.
Modified:
trunk/reactos/subsystems/win32/win32k/include/path.h
trunk/reactos/subsystems/win32/win32k/objects/line.c
trunk/reactos/subsystems/win32/win32k/objects/path.c
Modified: trunk/reactos/subsystems/win32/win32k/include/path.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/path.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/path.h Fri Nov 10 15:50:34 2006
@@ -3,7 +3,7 @@
#define PATH_IsPathOpen(path) ((path).state==PATH_Open)
-BOOL FASTCALL PATH_Arc (PDC dc, INT x1, INT y1, INT x2, INT y2, INT xStart, INT yStart,
INT xEnd, INT yEnd);
+BOOL FASTCALL PATH_Arc (PDC dc, INT x1, INT y1, INT x2, INT y2, INT xStart, INT yStart,
INT xEnd, INT yEnd, INT lines);
BOOL FASTCALL PATH_AssignGdiPath (GdiPath *pPathDest, const GdiPath *pPathSrc);
VOID FASTCALL PATH_DestroyGdiPath (GdiPath *pPath);
BOOL FASTCALL PATH_Ellipse (PDC dc, INT x1, INT y1, INT x2, INT y2);
Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/line.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/line.c Fri Nov 10 15:50:34 2006
@@ -299,7 +299,7 @@
if(PATH_IsPathOpen(dc->w.path))
{
return PATH_Arc(dc, LeftRect, TopRect, RightRect, BottomRect,
- XStartArc, YStartArc, XEndArc, YEndArc);
+ XStartArc, YStartArc, XEndArc, YEndArc, GdiTypeArc );
}
// FIXME
Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/path.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/path.c Fri Nov 10 15:50:34 2006
@@ -720,24 +720,29 @@
{
/* TODO: This should probably be revised to call PATH_AngleArc */
/* (once it exists) */
- return PATH_Arc ( dc, x1, y1, x2, y2, x1, (y1+y2)/2, x1, (y1+y2)/2 );
+ BOOL Ret = PATH_Arc ( dc, x1, y1, x2, y2, x1, (y1+y2)/2, x1, (y1+y2)/2, GdiTypeArc );
+ if (Ret) IntGdiCloseFigure(dc);
+ return Ret;
}
/* PATH_Arc
*
* Should be called when a call to Arc is performed on a DC that has
* an open path. This adds up to five Bezier splines representing the arc
- * to the path. Returns TRUE if successful, else FALSE.
+ * to the path. When 'lines' is 1, we add 1 extra line to get a chord,
+ * and when 'lines' is 2, we add 2 extra lines to get a pie.
+ * Returns TRUE if successful, else FALSE.
*/
BOOL
FASTCALL
PATH_Arc ( PDC dc, INT x1, INT y1, INT x2, INT y2,
- INT xStart, INT yStart, INT xEnd, INT yEnd)
+ INT xStart, INT yStart, INT xEnd, INT yEnd, INT lines)
{
double angleStart, angleEnd, angleStartQuadrant, angleEndQuadrant=0.0;
/* Initialize angleEndQuadrant to silence gcc's warning */
double x, y;
FLOAT_POINT corners[2], pointStart, pointEnd;
+ POINT centre;
BOOL start, end;
INT temp;
BOOL clockwise;
@@ -857,6 +862,19 @@
PATH_DoArcPart ( &dc->w.path, corners, angleStartQuadrant, angleEndQuadrant,
start );
start = FALSE;
} while(!end);
+
+ /* chord: close figure. pie: add line and close figure */
+ if(lines==GdiTypeChord) // 1
+ {
+ IntGdiCloseFigure(dc);
+ }
+ else if(lines==GdiTypePie) // 2
+ {
+ centre.x = (corners[0].x+corners[1].x)/2;
+ centre.y = (corners[0].y+corners[1].y)/2;
+ if(!PATH_AddEntry(&dc->w.path, ¢re, PT_LINETO | PT_CLOSEFIGURE))
+ return FALSE;
+ }
return TRUE;
}