diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-06-23 08:24:52 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-06-23 08:24:52 +0000 |
| commit | b909204392c9567564ee048eeea3b529420e1c86 (patch) | |
| tree | 2406345ce655d74e12d16b3de3cba88c327a54d8 /windows.c | |
| parent | 973ced1c7cfced5cb825841365058290821e81d2 (diff) | |
| download | puzzles-b909204392c9567564ee048eeea3b529420e1c86.zip puzzles-b909204392c9567564ee048eeea3b529420e1c86.tar.gz puzzles-b909204392c9567564ee048eeea3b529420e1c86.tar.bz2 puzzles-b909204392c9567564ee048eeea3b529420e1c86.tar.xz | |
Introduce a front-end function to draw circles.
[originally from svn r5991]
Diffstat (limited to 'windows.c')
| -rw-r--r-- | windows.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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) { |