diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-08-15 15:57:10 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-08-15 15:57:10 -0700 |
commit | 5ac18cef45a95cb678e5cebed3b9129bceb982dd (patch) | |
tree | e2cab1d601751ae8d7ffe9a4b43bdbc60e23eb03 | |
parent | a655c2113cdc80095402243ce41e1322dea535ab (diff) | |
parent | 333a0318d98866b6d34fc51f3eddb970457da1a5 (diff) | |
download | view.love-5ac18cef45a95cb678e5cebed3b9129bceb982dd.tar.gz |
Merge upstream
-rw-r--r-- | text.lua | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/text.lua b/text.lua index d46b6d4..bbe610a 100644 --- a/text.lua +++ b/text.lua @@ -17,16 +17,13 @@ function Text.draw(State, line_index, y, startpos) -- wrap long lines local x = State.left local pos = 1 - local screen_line_starting_pos = State.screen_top1.pos - if line_cache.fragments == nil then - Text.compute_fragments(State, line_index) - end + local screen_line_starting_pos = startpos Text.populate_screen_line_starting_pos(State, line_index) for _, f in ipairs(line_cache.fragments) do local frag, frag_text = f.data, f.text local frag_len = utf8.len(frag) --? print('text.draw:', frag, 'at', line_index,pos, 'after', x,y) - if Text.lt1({line=line_index, pos=pos}, State.screen_top1) then + if pos < startpos then -- render nothing --? print('skipping', frag) else @@ -638,9 +635,6 @@ end function Text.to_pos_on_line(State, line_index, mx, my) local line = State.lines[line_index] local line_cache = State.line_cache[line_index] - if line_cache.fragments == nil then - Text.compute_fragments(State, line_index) - end assert(my >= line_cache.starty) -- duplicate some logic from Text.draw local y = line_cache.starty |