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

20
osx.m
View File

@ -1172,6 +1172,26 @@ void draw_polygon(frontend *fe, int *coords, int npoints,
else
[path stroke];
}
void draw_circle(frontend *fe, int cx, int cy, int radius,
int fill, int colour)
{
NSBezierPath *path = [NSBezierPath bezierPath];
[[NSGraphicsContext currentContext] setShouldAntialias:YES];
assert(colour >= 0 && colour < fe->ncolours);
[fe->colours[colour] set];
[path appendBezierPathWithArcWithCenter:NSMakePoint(cx + 0.5, cy + 0.5)
radius:radius startAngle:0.0 endAngle:360.0];
[path closePath];
if (fill)
[path fill];
else
[path stroke];
}
void draw_line(frontend *fe, int x1, int y1, int x2, int y2, int colour)
{
NSBezierPath *path = [NSBezierPath bezierPath];