gdiplus: Updated GdipDrawArc to use SaveDC()/RestoreDC()/line caps.
This commit is contained in:
parent
1f7cfb1dc8
commit
40f2273f03
|
@ -418,24 +418,21 @@ GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
|
||||||
GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x,
|
GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x,
|
||||||
REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
|
REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
|
||||||
{
|
{
|
||||||
HGDIOBJ old_pen;
|
INT save_state, num_pts;
|
||||||
REAL x_0, y_0, x_1, y_1, x_2, y_2;
|
GpPointF points[MAX_ARC_PTS];
|
||||||
|
|
||||||
if(!graphics || !pen)
|
if(!graphics || !pen)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
old_pen = SelectObject(graphics->hdc, pen->gdipen);
|
num_pts = arc2polybezier(points, x, y, width, height, startAngle, sweepAngle);
|
||||||
|
|
||||||
x_0 = x + (width/2.0);
|
save_state = SaveDC(graphics->hdc);
|
||||||
y_0 = y + (height/2.0);
|
EndPath(graphics->hdc);
|
||||||
|
SelectObject(graphics->hdc, pen->gdipen);
|
||||||
|
|
||||||
deg2xy(startAngle+sweepAngle, x_0, y_0, &x_1, &y_1);
|
draw_polybezier(graphics->hdc, pen, points, num_pts, TRUE);
|
||||||
deg2xy(startAngle, x_0, y_0, &x_2, &y_2);
|
|
||||||
|
|
||||||
Arc(graphics->hdc, roundr(x), roundr(y), roundr(x+width), roundr(y+height),
|
RestoreDC(graphics->hdc, save_state);
|
||||||
roundr(x_1), roundr(y_1), roundr(x_2), roundr(y_2));
|
|
||||||
|
|
||||||
SelectObject(graphics->hdc, old_pen);
|
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue