From 490306a5fc006f8ced245e9fc049c52ffa0e088e Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Tue, 24 May 2016 15:19:50 -0400 Subject: [PATCH] shape: Add default rounded_rect radius Add an arbitrary value to avoid all caller setting extra arguments. --- lib/gears/shape.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/gears/shape.lua b/lib/gears/shape.lua index a7de80c4..af1cd566 100644 --- a/lib/gears/shape.lua +++ b/lib/gears/shape.lua @@ -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