doc: Improve the screen padding image.
It now shows the padding instead of the tiling area.
This commit is contained in:
parent
602d6ded07
commit
d97dccfa1f
|
@ -34,5 +34,5 @@ end --DOC_HIDE
|
||||||
return { --DOC_HIDE
|
return { --DOC_HIDE
|
||||||
factor = 2 , --DOC_HIDE
|
factor = 2 , --DOC_HIDE
|
||||||
show_boxes = false, --DOC_HIDE
|
show_boxes = false, --DOC_HIDE
|
||||||
highlight_tiling_area = true , --DOC_HIDE
|
highlight_padding_area = true , --DOC_HIDE
|
||||||
} --DOC_HIDE
|
} --DOC_HIDE
|
||||||
|
|
|
@ -79,6 +79,7 @@ local colors = {
|
||||||
geometry = "#000000",
|
geometry = "#000000",
|
||||||
workarea = "#0000ff",
|
workarea = "#0000ff",
|
||||||
tiling_area = "#ff0000",
|
tiling_area = "#ff0000",
|
||||||
|
padding_area= "#ff0000",
|
||||||
}
|
}
|
||||||
|
|
||||||
local function draw_area(_, rect, name, offset, highlight)
|
local function draw_area(_, rect, name, offset, highlight)
|
||||||
|
@ -96,6 +97,17 @@ local function draw_area(_, rect, name, offset, highlight)
|
||||||
cr:stroke()
|
cr:stroke()
|
||||||
end
|
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)
|
local function compute_ruler(_, rect, name)
|
||||||
table.insert(hrulers, {
|
table.insert(hrulers, {
|
||||||
label = name, x = rect.x, width = rect.width
|
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)
|
draw_area(s, s.workarea, "workarea", (k-1)*10, args.highlight_workarea)
|
||||||
|
|
||||||
-- The padding.
|
-- 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_area(s, s.tiling_area, "tiling_area", (k-1)*10, args.highlight_tiling_area)
|
||||||
|
|
||||||
-- Draw the ruler.
|
-- Draw the ruler.
|
||||||
|
|
Loading…
Reference in New Issue