layout: spiral: remove size check

This is already done by the C code.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Fabienne Ducroquet 2009-08-19 20:37:22 +02:00 committed by Julien Danjou
parent 46f5476e20
commit 034a93d691
1 changed files with 26 additions and 29 deletions

View File

@ -21,40 +21,37 @@ local function spiral(p, dwindle)
local nh = wa.height
for k, c in ipairs(cls) do
if (k % 2 == 0 and nh / 2 > 2 * c.border_width)
or (k % 2 == 1 and nw / 2 > 2 * c.border_width) then
if k < n then
if k % 2 == 0 then
nh = nh / 2
else
nw = nw / 2
end
if k % 4 == 3 and not dwindle then
nx = nx + nw
elseif k % 4 == 0 and not dwindle then
ny = ny + nh
end
if k < n then
if k % 2 == 0 then
nh = nh / 2
else
nw = nw / 2
end
if k % 4 == 1 then
if dwindle then
ny = ny + nh
else
ny = ny - nh
end
elseif k % 4 == 2 then
if k % 4 == 3 and not dwindle then
nx = nx + nw
elseif k % 4 == 3 then
elseif k % 4 == 0 and not dwindle then
ny = ny + nh
elseif k % 4 == 0 then
if dwindle then
nx = nx + nw
else
nx = nx - nw
end
end
if k == 1 then
ny = wa.y
end
if k % 4 == 1 then
if dwindle then
ny = ny + nh
else
ny = ny - nh
end
elseif k % 4 == 2 then
nx = nx + nw
elseif k % 4 == 3 then
ny = ny + nh
elseif k % 4 == 0 then
if dwindle then
nx = nx + nw
else
nx = nx - nw
end
end
if k == 1 then
ny = wa.y
end
local geom = { x = nx, y = ny, width = nw, height = nh }
c:geometry(geom)