mirror of
https://github.com/reactos/reactos.git
synced 2024-09-15 15:19:37 +00:00
Sync up PATH_Arc and PATH_Ellipse with Wine.
svn path=/trunk/; revision=24713
This commit is contained in:
parent
445e9e71b5
commit
065806e5f1
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#define PATH_IsPathOpen(path) ((path).state==PATH_Open)
|
#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);
|
BOOL FASTCALL PATH_AssignGdiPath (GdiPath *pPathDest, const GdiPath *pPathSrc);
|
||||||
VOID FASTCALL PATH_DestroyGdiPath (GdiPath *pPath);
|
VOID FASTCALL PATH_DestroyGdiPath (GdiPath *pPath);
|
||||||
BOOL FASTCALL PATH_Ellipse (PDC dc, INT x1, INT y1, INT x2, INT y2);
|
BOOL FASTCALL PATH_Ellipse (PDC dc, INT x1, INT y1, INT x2, INT y2);
|
||||||
|
|
|
@ -299,7 +299,7 @@ IntGdiArc(DC *dc,
|
||||||
if(PATH_IsPathOpen(dc->w.path))
|
if(PATH_IsPathOpen(dc->w.path))
|
||||||
{
|
{
|
||||||
return PATH_Arc(dc, LeftRect, TopRect, RightRect, BottomRect,
|
return PATH_Arc(dc, LeftRect, TopRect, RightRect, BottomRect,
|
||||||
XStartArc, YStartArc, XEndArc, YEndArc);
|
XStartArc, YStartArc, XEndArc, YEndArc, GdiTypeArc );
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
|
|
|
@ -720,24 +720,29 @@ PATH_Ellipse ( PDC dc, INT x1, INT y1, INT x2, INT y2 )
|
||||||
{
|
{
|
||||||
/* TODO: This should probably be revised to call PATH_AngleArc */
|
/* TODO: This should probably be revised to call PATH_AngleArc */
|
||||||
/* (once it exists) */
|
/* (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
|
/* PATH_Arc
|
||||||
*
|
*
|
||||||
* Should be called when a call to Arc is performed on a DC that has
|
* 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
|
* 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
|
BOOL
|
||||||
FASTCALL
|
FASTCALL
|
||||||
PATH_Arc ( PDC dc, INT x1, INT y1, INT x2, INT y2,
|
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;
|
double angleStart, angleEnd, angleStartQuadrant, angleEndQuadrant=0.0;
|
||||||
/* Initialize angleEndQuadrant to silence gcc's warning */
|
/* Initialize angleEndQuadrant to silence gcc's warning */
|
||||||
double x, y;
|
double x, y;
|
||||||
FLOAT_POINT corners[2], pointStart, pointEnd;
|
FLOAT_POINT corners[2], pointStart, pointEnd;
|
||||||
|
POINT centre;
|
||||||
BOOL start, end;
|
BOOL start, end;
|
||||||
INT temp;
|
INT temp;
|
||||||
BOOL clockwise;
|
BOOL clockwise;
|
||||||
|
@ -858,6 +863,19 @@ PATH_Arc ( PDC dc, INT x1, INT y1, INT x2, INT y2,
|
||||||
start = FALSE;
|
start = FALSE;
|
||||||
} while(!end);
|
} 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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue