From fd7d32c57c3996b11bff08e360e857d2de56c092 Mon Sep 17 00:00:00 2001 From: Murilo Miranda Date: Tue, 2 Jul 2019 01:16:38 -0300 Subject: [PATCH] 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. --- simpledisplay.d | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/simpledisplay.d b/simpledisplay.d index f48a928..6012752 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -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;