shape: Move_to is necessary for circle strokes

This commit is contained in:
Emmanuel Lepage Vallee 2016-08-04 17:16:31 -04:00
parent d03d63ecae
commit 9b5cecf53e
1 changed files with 1 additions and 0 deletions

View File

@ -331,6 +331,7 @@ end
-- @tparam[opt=math.min(width height) / 2)] number radius The radius -- @tparam[opt=math.min(width height) / 2)] number radius The radius
function module.circle(cr, width, height, radius) function module.circle(cr, width, height, radius)
radius = radius or math.min(width, height) / 2 radius = radius or math.min(width, height) / 2
cr:move_to(width/2+radius, height/2)
cr:arc(width / 2, height / 2, radius, 0, 2*math.pi) cr:arc(width / 2, height / 2, radius, 0, 2*math.pi)
cr:close_path() cr:close_path()
end end