about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-16 22:30:53 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-16 22:30:53 -0700
commit97531d9d05251a48f72bdb5602d58dd9b4a44cc4 (patch)
treed202de675b715c9e635f1c6a24f05dafbd76c751
parent04dc87482d05876ad2003f9d2e42cd555bf4f16c (diff)
downloadtext.love-97531d9d05251a48f72bdb5602d58dd9b4a44cc4.tar.gz
allow text to be typed while mouse hovers over drawing
The whole point of my keyboard shortcuts scheme is that if you press a
regular key and the mouse is not down, it goes in at the cursor.
-rw-r--r--main.lua13
1 files changed, 0 insertions, 13 deletions
diff --git a/main.lua b/main.lua
index 773a43b..0b3eedc 100644
--- a/main.lua
+++ b/main.lua
@@ -490,7 +490,6 @@ end
 
 function love.textinput(t)
   if love.mouse.isDown('1') then return end
-  if mouse_in_drawing() then return end
   if lines[cursor_line].mode == 'drawing' then return end
   local byteoffset
   if cursor_pos > 1 then
@@ -765,18 +764,6 @@ function nearest_cursor_pos(line, x, hint)
   return right
 end
 
-function mouse_in_drawing()
-  local x, y = love.mouse.getX(), love.mouse.getY()
-  for _,drawing in ipairs(lines) do
-    if drawing.mode == 'drawing' then
-      if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+drawingw then
-        return true
-      end
-    end
-  end
-  return false
-end
-
 function current_drawing()
   local x, y = love.mouse.getX(), love.mouse.getY()
   for _,drawing in ipairs(lines) do