This commit is contained in:
Xinhao Yuan 2019-08-10 16:25:42 -04:00
parent bd0a2fc15f
commit 830f0be459
1 changed files with 19 additions and 9 deletions

View File

@ -259,16 +259,14 @@ local function create(data)
local function push_children(c)
for i = #c, 1, -1 do
if c[i] ~= false then
if c[i].x ~= math.floor(c[i].x)
or c[i].y ~= math.floor(c[i].y)
or c[i].width ~= math.floor(c[i].width)
or c[i].height ~= math.floor(c[i].height)
then
print("warning, splitting yields floating area " .. _area_tostring(c[i]))
end
open_areas[#open_areas + 1] = c[i]
if c[i].x ~= math.floor(c[i].x)
or c[i].y ~= math.floor(c[i].y)
or c[i].width ~= math.floor(c[i].width)
or c[i].height ~= math.floor(c[i].height)
then
print("warning, splitting yields floating area " .. _area_tostring(c[i]))
end
open_areas[#open_areas + 1] = c[i]
end
end
@ -459,6 +457,18 @@ local function create(data)
end
end
-- clean up children, remove all `false'
local j = 1
for i = 1, #children do
if children[i] ~= false then
children[j] = children[i]
j = j + 1
end
end
for i = #children, j, -1 do
table.remove(children, i)
end
push_children(merged_children)
push_children(children)