From 93042a8dd6de97ba1ba89d54a2268a58480543cc Mon Sep 17 00:00:00 2001 From: Andrew Minnich Date: Mon, 26 Nov 2018 02:53:51 -0500 Subject: [PATCH 1/2] make segments argument of CircleShape:draw() functional --- shapes.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shapes.lua b/shapes.lua index f5422cd..98cf850 100644 --- a/shapes.lua +++ b/shapes.lua @@ -418,7 +418,8 @@ function ConcavePolygonShape:draw(mode, wireframe) end function CircleShape:draw(mode, segments) - love.graphics.circle(mode or 'line', self:outcircle()) + local x, y, r = self:outcircle() + love.graphics.circle(mode or 'line', x, y, r, segments) end function PointShape:draw() From f969ac2f96d5f1bbb18747f95c427113542eeb92 Mon Sep 17 00:00:00 2001 From: Andrew Minnich Date: Mon, 26 Nov 2018 03:00:32 -0500 Subject: [PATCH 2/2] document CircleShape:draw() --- docs/Shapes.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/Shapes.rst b/docs/Shapes.rst index b981b49..bf80a71 100644 --- a/docs/Shapes.rst +++ b/docs/Shapes.rst @@ -284,6 +284,13 @@ Built-in Shapes .. class:: CircleShape +.. function:: CircleShape:draw(mode, segments) + + :param DrawMode mode: How to draw the shape. Either 'line' or 'fill'. + :param number segments: The number of segments to draw the circle with. + +Draw the circle shape either filled or as an outline and with the specified number of segments. + .. class:: PointShape .. function:: newPolygonShape(...)