Give ScreenPainter another function

I am making a program that draws circles and I noticed there were no functions for that but I could make it happen by using drawArc() the right way so I figured it would be a good idea to add a drawCircle() function. This new function was crafted using the preexisting drawArc() function. I have tested it and it is much more practical than using drawArc() when working with pure circles.
This commit is contained in:
Murilo Miranda 2019-07-02 01:16:38 -03:00 committed by GitHub
parent 730a5af7e6
commit fd7d32c57c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -6604,6 +6604,13 @@ struct ScreenPainter {
impl.drawArc(upperLeft.x, upperLeft.y, width, height, start, finish);
}
//this function draws a circle using the drawArc() function above, it requires you to pass the point it
//will be drawn at as a Point struct and the radius as an int
void drawCircle(Point upperLeft, int radius)
{
this.drawArc(upperLeft, radius, radius, 0, 0);
}
/// .
void drawPolygon(Point[] vertexes) {
if(impl is null) return;