shape: Add default rounded_rect radius

Add an arbitrary value to avoid all caller setting extra arguments.
This commit is contained in:
Emmanuel Lepage Vallee 2016-05-24 15:19:50 -04:00
parent 47a471072a
commit 490306a5fc
1 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,8 @@ local module = {}
-- @tparam number height The rectangle height
-- @tparam number radius the corner radius
function module.rounded_rect(cr, width, height, radius)
radius = radius or 10
if width / 2 < radius then
radius = width / 2
end