From 348cd3a590077ea441435aad19a5d45c085f094f Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Tue, 26 Jan 2016 02:40:50 -0500 Subject: [PATCH] gears.shape: Add isosceles_triangle shape --- lib/gears/shape.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/gears/shape.lua b/lib/gears/shape.lua index cc6b4339..76b16f87 100644 --- a/lib/gears/shape.lua +++ b/lib/gears/shape.lua @@ -157,6 +157,17 @@ function module.powerline(cr, width, height, arrow_depth) cr:close_path() end +--- An isosceles triangle +-- @param cr A cairo context +-- @tparam number width The shape with +-- @tparam number height The shape height +function module.isosceles_triangle(cr, width, height) + cr:move_to( width/2, 0 ) + cr:line_to( width , height ) + cr:line_to( 0 , height ) + cr:close_path() +end + --- Ajust the shape using a transformation object -- -- Apply various transformations to the shape