diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-05-19 22:41:03 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-05-19 22:41:03 -0700 |
commit | e2b371ea37076c5bf7a7941f99aaf7eff3a5abdd (patch) | |
tree | fbf4c4752008c57788909e43ca055b23063271f1 | |
parent | 2f8d727c0bc220d2f762466ffe9754a6b3d4a6cc (diff) | |
download | text.love-e2b371ea37076c5bf7a7941f99aaf7eff3a5abdd.tar.gz |
bugfix: text past cursor was rendered red on wrapped lines
-rw-r--r-- | main.lua | 1 | ||||
-rw-r--r-- | text.lua | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/main.lua b/main.lua index 5583380..5c1abd9 100644 --- a/main.lua +++ b/main.lua @@ -119,6 +119,7 @@ function love.draw() -- cursor love.graphics.setColor(1,0,0) love.graphics.circle('fill', 25,y+math.floor(15*Zoom), 2) + love.graphics.setColor(0,0,0) end y = y + math.floor(15*Zoom) -- text height elseif line.mode == 'drawing' then diff --git a/text.lua b/text.lua index af3553b..6283763 100644 --- a/text.lua +++ b/text.lua @@ -70,6 +70,7 @@ function Text.draw(line, line_width, line_index, cursor_line, cursor_pos) -- cursor love.graphics.setColor(1,0,0) love.graphics.circle('fill', x+Text.cursor_x2(frag, cursor_pos-pos+1),y+math.floor(15*Zoom), 2) + love.graphics.setColor(0,0,0) end end x = x + frag_width @@ -79,6 +80,7 @@ function Text.draw(line, line_width, line_index, cursor_line, cursor_pos) -- cursor love.graphics.setColor(1,0,0) love.graphics.circle('fill', x,y+math.floor(15*Zoom), 2) + love.graphics.setColor(0,0,0) end return y end |