about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-03-18 23:45:01 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-03-18 23:45:01 -0700
commite8d6a8a26d435ee73dae93d97c91811f9ab4908b (patch)
treee508cc4f3458a11e92f913f9547e34f77a97a59e
parentfceb2404fb42475d53a23e6babdf7307c192c0c1 (diff)
downloadlines.love-e8d6a8a26d435ee73dae93d97c91811f9ab4908b.tar.gz
consistently use App names for methods everywhere
-rw-r--r--run.lua14
-rw-r--r--source.lua4
2 files changed, 9 insertions, 9 deletions
diff --git a/run.lua b/run.lua
index 4c29860..347eea9 100644
--- a/run.lua
+++ b/run.lua
@@ -48,14 +48,14 @@ end
 function run.load_settings()
   love.graphics.setFont(love.graphics.newFont(Settings.font_height))
   -- determine default dimensions and flags
-  App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
+  App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
   -- set up desired window dimensions
   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.width, App.screen.height = Settings.width, Settings.height
-  love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)
-  love.window.setPosition(Settings.x, Settings.y, Settings.displayindex)
+  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
@@ -76,15 +76,15 @@ end
 
 function run.initialize_window_geometry(em_width)
   -- maximize window
-  love.window.setMode(0, 0)  -- maximize
-  App.screen.width, App.screen.height, App.screen.flags = love.window.getMode()
+  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)
   App.screen.flags.minheight = math.min(App.screen.height, 200)
-  love.window.setMode(App.screen.width, App.screen.height, App.screen.flags)
+  App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
 end
 
 function run.resize(w, h)
@@ -131,7 +131,7 @@ function run.settings()
     Settings = {}
   end
   if Current_app == 'run' then
-    Settings.x, Settings.y, Settings.displayindex = love.window.getPosition()
+    Settings.x, Settings.y, Settings.displayindex = App.screen.position()
   end
   local filename = Editor_state.filename
   if is_relative_path(filename) then
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()