about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-08-17 16:13:46 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-08-17 16:13:46 -0700
commit3a74e4bb6cb350efa395e9d7189180e1cfc49af9 (patch)
tree451b7db8a5d68225da0e19187d2f85d0c8368253
parentdd899d20964342f22f4a82912d5722a5c9f5e663 (diff)
downloadview.love-3a74e4bb6cb350efa395e9d7189180e1cfc49af9.tar.gz
remove some unnecessary work
-rw-r--r--text.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/text.lua b/text.lua
index c67f327..fb85d63 100644
--- a/text.lua
+++ b/text.lua
@@ -18,7 +18,9 @@ function Text.draw(State, line_index, y, startpos)
   local x = State.left
   local pos = 1
   local screen_line_starting_pos = startpos
-  Text.populate_screen_line_starting_pos(State, line_index)
+  if line_cache.fragments == nil then
+    Text.compute_fragments(State, line_index)
+  end
   for _, f in ipairs(line_cache.fragments) do
     local frag, frag_text = f.data, f.text
     local frag_len = utf8.len(frag)