# Cleanup empty layers (layers that we never created)
cleanup-limit = 10
for i in reverse [til svg.children.length]
child = svg.children[i]
# first level is treated as "Layers"
if empty (child?.children or [])
console.warn "Deleting Layer?: ", child
svg.children.splice i, 1
cleanup-limit --
if cleanup-limit is 0
PNotify.notice text: """
We still need to remove empty layers from SVG (there were #{svg.children.length} layers).
Fix this."""
break
This code is removed from source:
Fix the
svg
object so that it shouldn't contain those empty<g>
nodes: https://github.com/aktos-io/aecad/blob/235e6b96b1932d9da4c533f121dd9c0801591612/webapps/main/pcb/kernel/import-export.ls#L80-L86