suit.fair: restored C version fair layout's behaviour

Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Gwenhael Le Moine 2008-12-16 18:27:52 +07:00 committed by Julien Danjou
parent 67a9f0d302
commit 25ac879569
1 changed files with 3 additions and 2 deletions

View File

@ -22,14 +22,15 @@ local function fair(screen, orientation)
local cls = client.tiled(screen)
if #cls > 0 then
local cells = math.floor(math.sqrt(#cls))
local cells = math.ceil(math.sqrt(#cls))
local strips = math.ceil(#cls / cells)
local cell = 0
local strip = 0
for k, c in ipairs(cls) do
local g = {}
if orientation == "east" then
if ( orientation == "east" and #cls > 2 )
or ( orientation == "south" and #cls <= 2 ) then
if #cls < (strips * cells) and strip == strips - 1 then
g.width = wa.width / (cells - ((strips * cells) - #cls))
else