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,7 +259,6 @@ local function create(data)
local function push_children(c) local function push_children(c)
for i = #c, 1, -1 do for i = #c, 1, -1 do
if c[i] ~= false then
if c[i].x ~= math.floor(c[i].x) if c[i].x ~= math.floor(c[i].x)
or c[i].y ~= math.floor(c[i].y) or c[i].y ~= math.floor(c[i].y)
or c[i].width ~= math.floor(c[i].width) or c[i].width ~= math.floor(c[i].width)
@ -270,7 +269,6 @@ local function create(data)
open_areas[#open_areas + 1] = c[i] open_areas[#open_areas + 1] = c[i]
end end
end end
end
local op_count = 0 local op_count = 0
@ -459,6 +457,18 @@ local function create(data)
end end
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(merged_children)
push_children(children) push_children(children)