wardley.love/0028-A

25 lines
937 B
Plaintext

A = function()
love.graphics.setFont(love.graphics.newFont(scale(20))) -- editor objects implicitly depend on current font
-- translate Nodes to Surface
Surface = {}
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, skip_updating_screen_top_for)
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()
-- TODO: ugly that we're manipulating editor objects twice
end