mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
shape: Add circle radius parameter.
This commit is contained in:
parent
15102c1fe9
commit
d03d63ecae
1 changed files with 4 additions and 3 deletions
|
@ -328,9 +328,10 @@ end
|
|||
-- @param cr A cairo context
|
||||
-- @tparam number width The shape width
|
||||
-- @tparam number height The shape height
|
||||
function module.circle(cr, width, height)
|
||||
local size = math.min(width, height) / 2
|
||||
cr:arc(width / 2, height / 2, size, 0, 2*math.pi)
|
||||
-- @tparam[opt=math.min(width height) / 2)] number radius The radius
|
||||
function module.circle(cr, width, height, radius)
|
||||
radius = radius or math.min(width, height) / 2
|
||||
cr:arc(width / 2, height / 2, radius, 0, 2*math.pi)
|
||||
cr:close_path()
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue