Commit 4aa99eaf authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Use GdipFillPath to implement GdipFillEllipse.

parent b5c20159
......@@ -3355,9 +3355,8 @@ GpStatus WINGDIPAPI GdipFillClosedCurveI(GpGraphics *graphics, GpBrush *brush,
GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x,
REAL y, REAL width, REAL height)
{
INT save_state;
GpPointF ptf[2];
POINT pti[2];
GpStatus stat;
GpPath *path;
TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, brush, x, y, width, height);
......@@ -3367,31 +3366,19 @@ GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x
if(graphics->busy)
return ObjectBusy;
if(!graphics->hdc)
{
FIXME("graphics object has no HDC\n");
return Ok;
}
ptf[0].X = x;
ptf[0].Y = y;
ptf[1].X = x + width;
ptf[1].Y = y + height;
save_state = SaveDC(graphics->hdc);
EndPath(graphics->hdc);
transform_and_round_points(graphics, pti, ptf, 2);
stat = GdipCreatePath(FillModeAlternate, &path);
BeginPath(graphics->hdc);
Ellipse(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y);
EndPath(graphics->hdc);
if (stat == Ok)
{
stat = GdipAddPathEllipse(path, x, y, width, height);
brush_fill_path(graphics, brush);
if (stat == Ok)
stat = GdipFillPath(graphics, brush, path);
RestoreDC(graphics->hdc, save_state);
GdipDeletePath(path);
}
return Ok;
return stat;
}
GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment