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MPXKKGFCL3ZKGDIAMLB2QC
filename = love.filesystem.getSourceBaseDirectory()..'/lines.txt', -- '/' should work even on Windows
next_save = nil,
local os = love.system.getOS()
if os == 'Android' or os == 'iOS' then
-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
-- no point second-guessing window dimensions on mobile
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
return
end
-- maximize window
-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.
App.screen.move(settings.x, settings.y-37, settings.displayindex)
end
function source.initialize_default_settings()
local font_height = 20
love.graphics.setFont(love.graphics.newFont(font_height))
local em = App.newText(love.graphics.getFont(), 'm')
source.initialize_window_geometry(App.width(em))
Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right)
-- maximize window to determine maximum allowable dimensions
App.screen.resize(0, 0) -- maximize
Display_width, Display_height, App.screen.flags = App.screen.size()
-- set up desired window dimensions
App.screen.flags.resizable = true
App.screen.flags.minwidth = math.min(Display_width, 200)
App.screen.flags.minheight = math.min(Display_height, 200)
App.screen.width, App.screen.height = settings.width, settings.height
--? print('setting window from settings:', App.screen.width, App.screen.height)
App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
end
function source.set_window_position_from_settings(settings)
end
end
function source.resize_window_from_settings(settings)
local os = love.system.getOS()
if os == 'Android' or os == 'iOS' then
-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
-- no point second-guessing window dimensions on mobile
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
return
end
source.resize_window_from_settings(settings)
--? print('loading source position', settings.x, settings.y, settings.displayindex)
source.set_window_position_from_settings(settings)
Show_log_browser_side = settings.show_log_browser_side
local right = App.screen.width - Margin_right
if Show_log_browser_side then
right = App.screen.width/2 - Margin_right
end
Editor_state = edit.initialize_state(Margin_top, Margin_left, right, settings.font_height, math.floor(settings.font_height*1.3))
Editor_state.filename = settings.filename
Settings.x, Settings.y, Settings.displayindex = App.screen.position()
end
App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
end
function run.resize(w, h)
--? print(("Window resized to width: %d and height: %d."):format(w, h))
App.screen.width, App.screen.height = w, h
Text.redraw_all(Editor_state)
Editor_state.selection1 = {} -- no support for shift drag while we're resizing
Editor_state.right = App.screen.width-Margin_right
Editor_state.width = Editor_state.right-Editor_state.left
Text.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)
end
App.screen.resize(0, 0) -- maximize
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
-- shrink height slightly to account for window decoration
App.screen.height = App.screen.height-100
App.screen.width = 40*em_width
App.screen.flags.resizable = true
App.screen.flags.minwidth = math.min(App.screen.width, 200)
local os = love.system.getOS()
if os == 'Android' or os == 'iOS' then
-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
-- no point second-guessing window dimensions on mobile
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
return
end
-- maximize window
App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
App.screen.move(Settings.x, Settings.y, Settings.displayindex)
Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, Settings.font_height, math.floor(Settings.font_height*1.3))
Editor_state.filename = Settings.filename
Editor_state.screen_top1 = Settings.screen_top
Editor_state.cursor1 = Settings.cursor
end
function run.initialize_default_settings()
local font_height = 20
love.graphics.setFont(love.graphics.newFont(font_height))
local em = App.newText(love.graphics.getFont(), 'm')
run.initialize_window_geometry(App.width(em))
Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right)
Editor_state.font_height = font_height
Editor_state.line_height = math.floor(font_height*1.3)
Editor_state.em = em
Settings = run.settings()
end
function run.initialize_window_geometry(em_width)
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
-- set up desired window dimensions
-- maximize window to determine maximum allowable dimensions
App.screen.resize(0, 0) -- maximize
Display_width, Display_height, App.screen.flags = App.screen.size()
-- set up desired window dimensions
App.screen.flags.resizable = true
App.screen.flags.minwidth = math.min(Display_width, 200)
App.screen.flags.minheight = math.min(Display_height, 200)
App.screen.width, App.screen.height = settings.width, settings.height
--? print('setting window from settings:', App.screen.width, App.screen.height)
App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
source.resize_window_from_settings(settings)
end
end
function source.resize_window_from_settings(settings)
local os = love.system.getOS()
if os == 'Android' or os == 'iOS' then
-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
-- no point second-guessing window dimensions on mobile
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
return
-- maximize window to determine maximum allowable dimensions
App.screen.resize(0, 0) -- maximize
Display_width, Display_height, App.screen.flags = App.screen.size()
-- set up desired window dimensions
App.screen.flags.resizable = true
App.screen.flags.minwidth = math.min(Display_width, 200)
App.screen.flags.minheight = math.min(Display_height, 200)
App.screen.width, App.screen.height = settings.width, settings.height
--? print('setting window from settings:', App.screen.width, App.screen.height)
App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
-- setPosition doesn't quite seem to do what is asked of it on Linux.
love.window.setPosition(settings.x, settings.y-37, settings.displayindex)
-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.
App.screen.move(settings.x, settings.y-37, settings.displayindex)
local os = love.system.getOS()
if os == 'Android' or os == 'iOS' then
-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
-- no point second-guessing window dimensions on mobile
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
return
end