layout: Avoid creating negative geometries when adding gaps

This commit is contained in:
Emmanuel Lepage Vallee 2016-04-18 01:24:12 -04:00
parent 9991f9ccc8
commit b938a99e1e
1 changed files with 2 additions and 2 deletions

View File

@ -172,8 +172,8 @@ function layout.arrange(screen)
p.geometries = setmetatable({}, {__mode = "k"}) p.geometries = setmetatable({}, {__mode = "k"})
layout.get(screen).arrange(p) layout.get(screen).arrange(p)
for c, g in pairs(p.geometries) do for c, g in pairs(p.geometries) do
g.width = g.width - c.border_width * 2 - useless_gap * 2 g.width = math.max(1, g.width - c.border_width * 2 - useless_gap * 2)
g.height = g.height - c.border_width * 2 - useless_gap * 2 g.height = math.max(1, g.height - c.border_width * 2 - useless_gap * 2)
g.x = g.x + useless_gap g.x = g.x + useless_gap
g.y = g.y + useless_gap g.y = g.y + useless_gap
c:geometry(g) c:geometry(g)