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.
This commit is contained in:
Kartik K. Agaram 2022-05-16 22:30:53 -07:00
parent 04dc87482d
commit 97531d9d05
1 changed files with 0 additions and 13 deletions

View File

@ -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