From 57e370700f91a2fce5afa279f8de035237a5adee Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Wed, 9 Mar 2016 23:42:41 -0500 Subject: [PATCH] shape: Add losange shape --- lib/gears/shape.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/gears/shape.lua b/lib/gears/shape.lua index 552fe0eda..64dfd9c47 100644 --- a/lib/gears/shape.lua +++ b/lib/gears/shape.lua @@ -264,6 +264,18 @@ function module.parallelogram(cr, width, height, base_width) cr:close_path() end +-- A losange +-- @param cr A cairo context +-- @tparam number width The shape width +-- @tparam number height The shape height +function module.losange(cr, width, height) + cr:move_to(width/2 , 0 ) + cr:line_to(width , height/2 ) + cr:line_to(width/2 , height ) + cr:line_to(0 , height/2 ) + cr:close_path() +end + --- Ajust the shape using a transformation object -- -- Apply various transformations to the shape