Thanks Myte for helping track this down.
B6F5N57RQOF7AWZ3OOVR72RDWUO6DWSCOMLYB5LELKLQQW24Q6EAC
NFI42KGXEHTNACH2CATBLJIAXJYNV2C3QBPR2ORPJZKOVEREVM7QC
QZ2SXLHF6G3RBSLFIOYM3AQYWLGPWRTASNNQMOQBI5ASUAYCO6UAC
5RDWSYK2YESTIEDMGOD2T7E4KCOA6DOM35ECMZT2XZT57JSCRJEQC
4J4TX7ISH3VIRSDYMGIJJ2WMTI2LPYJHFRWGGMXCEFTAYZOWXMAQC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
UUTUPEOJQBLCXRTXHU6W2QNDH536RH5M3GO6GZGSDEH2GANCD2GQC
JMUD7T3OJTEF5V73Y2B2GSVUBNBSJFRJPZNREBE5E4BV3IG6SJLQC
S3PNFXTB4EF4PR4RMDK3YX5HTBJP2U6GRBX5UWAMUFBC5CRPOWZAC
SDO4DHNUAERLBZOAVCFDGN65T4DX2PDY5RVLZKDOL6EZ62G5K67QC
EJOZAD7N3G5IIPRVRXV2T2JV36LAFNWHPL3TRBKAOIKT63M7FYRAC
ZJOSQFN6CH475MQZ5EXWSWILKNC77RVFEN44KQ2Y4EQJ2BC5YFCAC
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)
end
function source.set_window_position_from_settings(settings)
-- 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_window_geometry(em_width)
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(0, 0) -- maximize
Display_width, Display_height, App.screen.flags = App.screen.size()
-- shrink height slightly to account for window decoration
App.screen.height = Display_height-100
App.screen.width = 40*em_width
App.screen.flags.resizable = true
App.screen.flags.minwidth = math.min(App.screen.width, 200)
App.screen.flags.minheight = math.min(App.screen.height, 200)
App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
print('initializing source position')
if Settings == nil then Settings = {} end
if Settings.source == nil then Settings.source = {} end
Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position()
end
function source.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
if Show_log_browser_side then
Editor_state.right = App.screen.width/2 - Margin_right
else
Editor_state.right = App.screen.width-Margin_right
end
Log_browser_state.left = App.screen.width/2 + Margin_right
Log_browser_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)
--? print('end resize')
if Current_app == 'source' then
--? print('reading source window position')
Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position()
end
--? print('saving source settings', Settings.source.x, Settings.source.y, Settings.source.displayindex)