Introduce a front-end function to draw circles.

[originally from svn r5991]
This commit is contained in:
Simon Tatham
2005-06-23 08:24:52 +00:00
parent 973ced1c7c
commit b909204392
4 changed files with 49 additions and 0 deletions

View File

@ -330,6 +330,24 @@ void draw_line(frontend *fe, int x1, int y1, int x2, int y2, int colour)
SelectObject(fe->hdc_bm, oldpen);
}
void draw_circle(frontend *fe, int cx, int cy, int radius,
int fill, int colour)
{
if (fill) {
HBRUSH oldbrush = SelectObject(fe->hdc_bm, fe->brushes[colour]);
HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]);
Ellipse(fe->hdc_bm, cx - radius, cy - radius,
cx + radius + 1, cy + radius + 1);
SelectObject(fe->hdc_bm, oldbrush);
SelectObject(fe->hdc_bm, oldpen);
} else {
HPEN oldpen = SelectObject(fe->hdc_bm, fe->pens[colour]);
MoveToEx(fe->hdc_bm, cx + radius, cy, NULL);
AngleArc(fe->hdc_bm, cx, cy, radius, 0.0F, 360.0F);
SelectObject(fe->hdc_bm, oldpen);
}
}
void draw_polygon(frontend *fe, int *coords, int npoints,
int fill, int colour)
{