mirror of https://github.com/adamdruppe/arsd.git
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:
parent
730a5af7e6
commit
fd7d32c57c
|
|
@ -6604,6 +6604,13 @@ struct ScreenPainter {
|
||||||
impl.drawArc(upperLeft.x, upperLeft.y, width, height, start, finish);
|
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) {
|
void drawPolygon(Point[] vertexes) {
|
||||||
if(impl is null) return;
|
if(impl is null) return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue