From d97dccfa1f08d46984be9a728846b30514fef218 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Sun, 25 Aug 2019 15:35:17 -0400 Subject: [PATCH] doc: Improve the screen padding image. It now shows the padding instead of the tiling area. --- tests/examples/screen/padding.lua | 2 +- tests/examples/screen/template.lua | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/examples/screen/padding.lua b/tests/examples/screen/padding.lua index dba00d73..79b9e049 100644 --- a/tests/examples/screen/padding.lua +++ b/tests/examples/screen/padding.lua @@ -34,5 +34,5 @@ end --DOC_HIDE return { --DOC_HIDE factor = 2 , --DOC_HIDE show_boxes = false, --DOC_HIDE - highlight_tiling_area = true , --DOC_HIDE + highlight_padding_area = true , --DOC_HIDE } --DOC_HIDE diff --git a/tests/examples/screen/template.lua b/tests/examples/screen/template.lua index 75d4f701..761e4d6f 100644 --- a/tests/examples/screen/template.lua +++ b/tests/examples/screen/template.lua @@ -79,6 +79,7 @@ local colors = { geometry = "#000000", workarea = "#0000ff", tiling_area = "#ff0000", + padding_area= "#ff0000", } local function draw_area(_, rect, name, offset, highlight) @@ -96,6 +97,17 @@ local function draw_area(_, rect, name, offset, highlight) cr:stroke() end +local function draw_bounding_area(_, rect, hole, name, offset) + draw_area(_, rect, name, offset, true) + + local x, y = hole.x*factor+offset, hole.y*factor+offset + cr:set_operator(cairo.Operator.CLEAR) + cr:rectangle(x, y, hole.width*factor, hole.height*factor) + cr:set_source_rgb(1, 1, 1) + cr:fill() + cr:set_operator(cairo.Operator.OVER) +end + local function compute_ruler(_, rect, name) table.insert(hrulers, { label = name, x = rect.x, width = rect.width @@ -314,6 +326,10 @@ for k=1, screen.count() do draw_area(s, s.workarea, "workarea", (k-1)*10, args.highlight_workarea) -- The padding. + if args.highlight_padding_area then + draw_bounding_area(s, s.workarea, s.tiling_area, "padding_area", (k-1)*10) + end + draw_area(s, s.tiling_area, "tiling_area", (k-1)*10, args.highlight_tiling_area) -- Draw the ruler.