From 1060a3487ef8a62266de6f899a25bec2b2526f22 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Tue, 26 Jan 2016 02:31:42 -0500 Subject: [PATCH] gears.shape: Add rectangular_tag shape --- lib/gears/shape.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/gears/shape.lua b/lib/gears/shape.lua index e9d2ba30b..cc7dc605a 100644 --- a/lib/gears/shape.lua +++ b/lib/gears/shape.lua @@ -87,6 +87,20 @@ function module.infobubble(cr, width, height, corner_radius, arrow_size, arrow_p cr:close_path() end +--- A rectangle terminated by an arrow +-- @param cr A cairo context +-- @tparam number width The shape with +-- @tparam number height The shape height +function module.rectangular_tag(cr, width, height) + cr:move_to(0 , height/2) + cr:line_to(height/2 , 0 ) + cr:line_to(width , 0 ) + cr:line_to(width , height ) + cr:line_to(height/2 , height ) + + cr:close_path() +end + --- Ajust the shape using a transformation object -- -- Apply various transformations to the shape