From e8d6a8a26d435ee73dae93d97c91811f9ab4908b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 18 Mar 2023 23:45:01 -0700 Subject: consistently use App names for methods everywhere --- source.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source.lua') diff --git a/source.lua b/source.lua index f224459..5c8bb82 100644 --- a/source.lua +++ b/source.lua @@ -137,8 +137,8 @@ function source.load_settings() end function source.set_window_position_from_settings(settings) - -- 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) end function source.initialize_default_settings() -- cgit 1.4.1-2-gfad0 From 1b90ffca9ef5d3c1b47808841bcf20c55a73cb4d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 18 Mar 2023 23:48:42 -0700 Subject: extract a function --- source.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'source.lua') diff --git a/source.lua b/source.lua index 5c8bb82..0fdd7f6 100644 --- a/source.lua +++ b/source.lua @@ -105,16 +105,7 @@ end function source.load_settings() local settings = Settings.source love.graphics.setFont(love.graphics.newFont(settings.font_height)) - -- 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) --? 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 @@ -136,6 +127,19 @@ function source.load_settings() end end +function source.resize_window_from_settings(settings) + -- 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) -- cgit 1.4.1-2-gfad0 From 30e75991ce3430550d7565c8141fc8ed68c67290 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 18 Mar 2023 23:50:30 -0700 Subject: get typed in keystrokes to show on screen on iPad Many thanks to Myte for helping test this! --- run.lua | 7 +++++++ source.lua | 14 ++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'source.lua') diff --git a/run.lua b/run.lua index 347eea9..28516f6 100644 --- a/run.lua +++ b/run.lua @@ -75,6 +75,13 @@ function run.initialize_default_settings() end function run.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 App.screen.width, App.screen.height, App.screen.flags = App.screen.size() diff --git a/source.lua b/source.lua index 0fdd7f6..f4f6600 100644 --- a/source.lua +++ b/source.lua @@ -128,6 +128,13 @@ function source.load_settings() 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 -- maximize window to determine maximum allowable dimensions App.screen.resize(0, 0) -- maximize Display_width, Display_height, App.screen.flags = App.screen.size() @@ -158,6 +165,13 @@ function source.initialize_default_settings() 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() -- cgit 1.4.1-2-gfad0