about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-17 10:06:39 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-17 10:06:39 -0700
commit64eed749809a4412a6663d149cd57a41431df91d (patch)
treeb51ab0593c43a60cb64ca86c0b23b5c42b9f36e5 /text.lua
parent4ff6de99511e0b4c52acc49ec44d773aca63a2fd (diff)
downloadlines.love-64eed749809a4412a6663d149cd57a41431df91d.tar.gz
keep all text cache writes inside text.lua
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/text.lua b/text.lua
index 3af0a13..8bd0fac 100644
--- a/text.lua
+++ b/text.lua
@@ -6,16 +6,16 @@ require 'select'
 require 'undo'
 require 'text_tests'
 
--- return values:
---  y coordinate drawn until in px
---  position of start of final screen line drawn
-function Text.draw(State, line_index)
+-- draw a line starting from startpos to screen at y between State.left and State.right
+-- return the final y, and position of start of final screen line drawn
+function Text.draw(State, line_index, y, startpos)
 --?   print('text.draw', line_index)
   App.color(Text_color)
   local line = State.lines[line_index]
+  line.starty = y
+  line.startpos = startpos
   -- wrap long lines
   local x = State.left
-  local y = line.starty
   local pos = 1
   local screen_line_starting_pos = 1
   if line.fragments == nil then