diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2024-01-15 01:45:35 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2024-01-15 01:45:35 -0800 |
commit | dedb843535f3a4fc1a1f9f71100c80fc1e5d87e4 (patch) | |
tree | c77d28b50b7b4def159e574533f7c551d6b9e65a /source_select.lua | |
parent | 6c568c6ef0d69fddcbaf93d233e46a7e75ee7845 (diff) | |
parent | 348852ee2bdeffee303ec4f8ce796e7605caa62d (diff) | |
download | view.love-dedb843535f3a4fc1a1f9f71100c80fc1e5d87e4.tar.gz |
Merge text.love
Diffstat (limited to 'source_select.lua')
-rw-r--r-- | source_select.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source_select.lua b/source_select.lua index 5434988..6e21c7b 100644 --- a/source_select.lua +++ b/source_select.lua @@ -57,11 +57,11 @@ function Text.draw_highlight(State, line, x,y, pos, lo,hi) lo_px = 0 else local before = line.data:sub(pos_offset, lo_offset-1) - lo_px = App.width(before) + lo_px = State.font:getWidth(before) end local s = line.data:sub(lo_offset, hi_offset-1) App.color(Highlight_color) - love.graphics.rectangle('fill', x+lo_px,y, App.width(s),State.line_height) + love.graphics.rectangle('fill', x+lo_px,y, State.font:getWidth(s),State.line_height) App.color(Text_color) return lo_px end |