about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-12-23 19:26:05 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-12-23 19:32:58 -0800
commite0448d7d7f1f6ec7ff88b222f59abe88503437e6 (patch)
tree6ffd24d059b9dc4ac0b333f835fae4c83249ef5d
parent2b3e09ca0fadcaaeac8d563aae1baeb7e7da3754 (diff)
downloadview.love-e0448d7d7f1f6ec7ff88b222f59abe88503437e6.tar.gz
consistent names in a few more places
-rw-r--r--drawing.lua2
-rw-r--r--edit.lua8
-rw-r--r--log_browser.lua2
-rw-r--r--main.lua4
-rw-r--r--source.lua8
-rw-r--r--source_edit.lua8
6 files changed, 16 insertions, 16 deletions
diff --git a/drawing.lua b/drawing.lua
index 3d9cd53..99193c6 100644
--- a/drawing.lua
+++ b/drawing.lua
@@ -218,7 +218,7 @@ function Drawing.in_drawing(drawing, line_cache, x,y, left,right)
   return y >= line_cache.starty and y < line_cache.starty + Drawing.pixels(drawing.h, width) and x >= left and x < right
 end
 
-function Drawing.mouse_pressed(State, drawing_index, x,y, mouse_button)
+function Drawing.mouse_press(State, drawing_index, x,y, mouse_button)
   local drawing = State.lines[drawing_index]
   local line_cache = State.line_cache[drawing_index]
   local cx = Drawing.coord(x-State.left, State.width)
diff --git a/edit.lua b/edit.lua
index ed5a79f..4d36780 100644
--- a/edit.lua
+++ b/edit.lua
@@ -195,7 +195,7 @@ function edit.quit(State)
   end
 end
 
-function edit.mouse_pressed(State, x,y, mouse_button)
+function edit.mouse_press(State, x,y, mouse_button)
   if State.search_term then return end
 --?   print('press', State.selection1.line, State.selection1.pos)
   if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
@@ -231,7 +231,7 @@ function edit.mouse_pressed(State, x,y, mouse_button)
         State.lines.current_drawing_index = line_index
         State.lines.current_drawing = line
         Drawing.before = snapshot(State, line_index)
-        Drawing.mouse_pressed(State, line_index, x,y, mouse_button)
+        Drawing.mouse_press(State, line_index, x,y, mouse_button)
         break
       end
     end
@@ -508,7 +508,7 @@ end
 
 function edit.run_after_mouse_click(State, x,y, mouse_button)
   App.fake_mouse_press(x,y, mouse_button)
-  edit.mouse_pressed(State, x,y, mouse_button)
+  edit.mouse_press(State, x,y, mouse_button)
   App.fake_mouse_release(x,y, mouse_button)
   edit.mouse_release(State, x,y, mouse_button)
   App.screen.contents = {}
@@ -518,7 +518,7 @@ end
 
 function edit.run_after_mouse_press(State, x,y, mouse_button)
   App.fake_mouse_press(x,y, mouse_button)
-  edit.mouse_pressed(State, x,y, mouse_button)
+  edit.mouse_press(State, x,y, mouse_button)
   App.screen.contents = {}
   edit.update(State, 0)
   edit.draw(State)
diff --git a/log_browser.lua b/log_browser.lua
index eb6c120..76596f2 100644
--- a/log_browser.lua
+++ b/log_browser.lua
@@ -194,7 +194,7 @@ end
 function log_browser.quit(State)
 end
 
-function log_browser.mouse_pressed(State, x,y, mouse_button)
+function log_browser.mouse_press(State, x,y, mouse_button)
   local line_index = log_browser.line_index(State, x,y)
   if line_index == nil then
     -- below lower margin
diff --git a/main.lua b/main.lua
index c078f10..8270858 100644
--- a/main.lua
+++ b/main.lua
@@ -227,9 +227,9 @@ end
 function App.mousepressed(x,y, mouse_button)
 --?   print('mouse press', x,y)
   if Current_app == 'run' then
-    if run.mouse_pressed then run.mouse_pressed(x,y, mouse_button) end
+    if run.mouse_pressed then run.mouse_press(x,y, mouse_button) end
   elseif Current_app == 'source' then
-    if source.mouse_pressed then source.mouse_pressed(x,y, mouse_button) end
+    if source.mouse_pressed then source.mouse_press(x,y, mouse_button) end
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
diff --git a/source.lua b/source.lua
index 0e1d478..f0022be 100644
--- a/source.lua
+++ b/source.lua
@@ -285,14 +285,14 @@ function source.settings()
   }
 end
 
-function source.mouse_pressed(x,y, mouse_button)
+function source.mouse_press(x,y, mouse_button)
   Cursor_time = 0  -- ensure cursor is visible immediately after it moves
 --?   print('mouse click', x, y)
 --?   print(Editor_state.left, Editor_state.right)
 --?   print(Log_browser_state.left, Log_browser_state.right)
   if Show_file_navigator and y < Menu_status_bar_height + File_navigation.num_lines * Editor_state.line_height then
     -- send click to buttons
-    edit.mouse_pressed(Editor_state, x,y, mouse_button)
+    edit.mouse_press(Editor_state, x,y, mouse_button)
     return
   end
   if x < Editor_state.right + Margin_right then
@@ -301,14 +301,14 @@ function source.mouse_pressed(x,y, mouse_button)
       Focus = 'edit'
       return
     end
-    edit.mouse_pressed(Editor_state, x,y, mouse_button)
+    edit.mouse_press(Editor_state, x,y, mouse_button)
   elseif Show_log_browser_side and Log_browser_state.left <= x and x < Log_browser_state.right then
 --?     print('click on log_browser side')
     if Focus ~= 'log_browser' then
       Focus = 'log_browser'
       return
     end
-    log_browser.mouse_pressed(Log_browser_state, x,y, mouse_button)
+    log_browser.mouse_press(Log_browser_state, x,y, mouse_button)
     for _,line_cache in ipairs(Editor_state.line_cache) do line_cache.starty = nil end  -- just in case we scroll
   end
 end
diff --git a/source_edit.lua b/source_edit.lua
index 53fb232..f9722eb 100644
--- a/source_edit.lua
+++ b/source_edit.lua
@@ -208,7 +208,7 @@ function edit.quit(State)
   end
 end
 
-function edit.mouse_pressed(State, x,y, mouse_button)
+function edit.mouse_press(State, x,y, mouse_button)
   if State.search_term then return end
 --?   print('press')
   if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
@@ -243,7 +243,7 @@ function edit.mouse_pressed(State, x,y, mouse_button)
         State.lines.current_drawing_index = line_index
         State.lines.current_drawing = line
         Drawing.before = snapshot(State, line_index)
-        Drawing.mouse_pressed(State, line_index, x,y, mouse_button)
+        Drawing.mouse_press(State, line_index, x,y, mouse_button)
         break
       end
     end
@@ -561,7 +561,7 @@ end
 
 function edit.run_after_mouse_click(State, x,y, mouse_button)
   App.fake_mouse_press(x,y, mouse_button)
-  edit.mouse_pressed(State, x,y, mouse_button)
+  edit.mouse_press(State, x,y, mouse_button)
   App.fake_mouse_release(x,y, mouse_button)
   edit.mouse_release(State, x,y, mouse_button)
   App.screen.contents = {}
@@ -571,7 +571,7 @@ end
 
 function edit.run_after_mouse_press(State, x,y, mouse_button)
   App.fake_mouse_press(x,y, mouse_button)
-  edit.mouse_pressed(State, x,y, mouse_button)
+  edit.mouse_press(State, x,y, mouse_button)
   App.screen.contents = {}
   edit.update(State, 0)
   edit.draw(State)