diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-05-16 21:36:44 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-05-16 21:36:44 -0700 |
commit | 741018db1f1ceca00b1a0b471c58115334db4502 (patch) | |
tree | d179e115a6088c4638d8a45f60eadcb9027a0970 /main.lua | |
parent | 5a4b8451ce01efca0f37d55c9668296136fbc3c5 (diff) | |
download | lines.love-741018db1f1ceca00b1a0b471c58115334db4502.tar.gz |
bugfix: up/down across drawings
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main.lua b/main.lua index 2656477..6992a61 100644 --- a/main.lua +++ b/main.lua @@ -710,12 +710,14 @@ function keychord_pressed(chord) end function cursor_x(line, cursor_pos) + if type(line) == 'table' then return 0 end local line_before_cursor = line:sub(1, cursor_pos-1) local text_before_cursor = love.graphics.newText(love.graphics.getFont(), line_before_cursor) return text_before_cursor:getWidth() end function nearest_cursor_pos(line, x, hint) + if type(line) == 'table' then return hint end if x == 0 then return 1 end |