A = function(preserve_screen_top_of_cursor_node)
love.graphics.setFont(love.graphics.newFont(scale(20))) -- editor objects implicitly depend on current font
-- translate Nodes to Surface
while #Surface > 0 do table.remove(Surface) end
local n = 1000
table.insert(Surface, {type='line', data={-n,0, n,0}})
table.insert(Surface, {type='line', data={-n,0, -n,-n}})
table.insert(Surface, {type='line', data={-n/2,0, -n/2,-n}, r=0.5,g=0.5,b=0.5})
table.insert(Surface, {type='line', data={0,0, 0,-n}, r=0.5,g=0.5,b=0.5})
table.insert(Surface, {type='line', data={n/2,0, n/2,-n}, r=0.5,g=0.5,b=0.5})
for key,node in pairs(Nodes) do
node.id = key
compute_layout(node, node.x,node.y, Surface, preserve_screen_top_of_cursor_node)
end
-- draw edges after all nodes have been initialized
for key,node in pairs(Nodes) do
for _,d in ipairs(node.outgoing_edges) do
compute_layout_for_edge(key, d)
end
end
-- continue the pipeline
B(preserve_screen_top_of_cursor_node)
-- TODO: ugly that we're manipulating editor objects twice
end