Merge snap.love

This commit is contained in:
Kartik K. Agaram 2023-07-10 12:58:54 -07:00
commit 524ef02780
3 changed files with 6 additions and 7 deletions

View File

@ -6,8 +6,6 @@ on.initialize = function(arg)
if Settings[Filename] then
Viewport = Settings[Filename].viewport
end
if file_exists(Filename) then
load_graph_from_disk()
end
load_graph_from_disk()
A()
end

View File

@ -1,7 +1,10 @@
load_graph_from_disk = function()
local f = App.open_for_reading(Filename)
local data = json.decode(f:read('*a'))
if f == nil then return end
local contents = f:read('*a')
f:close()
if contents == '' then return end
local data = json.decode(contents)
Nodes = data.nodes or {}
First_available_id = data.next
end

View File

@ -5,8 +5,6 @@ on.file_drop = function(file)
end
Filename = file:getFilename()
love.window.setTitle('wardley.love - '..Filename)
if file_exists(Filename) then
load_graph_from_disk()
end
load_graph_from_disk()
A()
end