gdiplus: Reimplement GdipDrawEllipse using GdipDrawPath.

This commit is contained in:
Dmitry Timoshkov 2013-02-19 11:45:23 +08:00 committed by Alexandre Julliard
parent ad49f83c7d
commit 6df50f1d16
1 changed files with 9 additions and 22 deletions

View File

@ -2759,9 +2759,8 @@ GpStatus WINGDIPAPI GdipDrawCurve3I(GpGraphics *graphics, GpPen *pen,
GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x,
REAL y, REAL width, REAL height) REAL y, REAL width, REAL height)
{ {
INT save_state; GpPath *path;
GpPointF ptf[2]; GpStatus status;
POINT pti[2];
TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height); TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height);
@ -2771,27 +2770,15 @@ GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x,
if(graphics->busy) if(graphics->busy)
return ObjectBusy; return ObjectBusy;
if (!graphics->hdc) status = GdipCreatePath(FillModeAlternate, &path);
{ if (status != Ok) return status;
FIXME("graphics object has no HDC\n");
return Ok;
}
ptf[0].X = x; status = GdipAddPathEllipse(path, x, y, width, height);
ptf[0].Y = y; if (status == Ok)
ptf[1].X = x + width; status = GdipDrawPath(graphics, pen, path);
ptf[1].Y = y + height;
save_state = prepare_dc(graphics, pen); GdipDeletePath(path);
SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH)); return status;
transform_and_round_points(graphics, pti, ptf, 2);
Ellipse(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y);
restore_dc(graphics, save_state);
return Ok;
} }
GpStatus WINGDIPAPI GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x, GpStatus WINGDIPAPI GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x,