about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-04-02 17:19:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-04-02 17:19:03 -0700
commit384fb2d19cf5879882426df9e31c77ad7e5bcc8d (patch)
tree149655baa64ad2d85529f8638fbdea353df290bf
parent29f1687f3c6a494eb67029acbeefbf11571bbe2c (diff)
downloadview.love-384fb2d19cf5879882426df9e31c77ad7e5bcc8d.tar.gz
streamline the interface for Text.draw
-rw-r--r--edit.lua1
-rw-r--r--text.lua4
2 files changed, 2 insertions, 3 deletions
diff --git a/edit.lua b/edit.lua
index 9a198f3..4e0f972 100644
--- a/edit.lua
+++ b/edit.lua
@@ -183,7 +183,6 @@ function edit.draw(State)
         })
       end
       y, State.screen_bottom1.pos = Text.draw(State, line_index, y, startpos)
-      y = y + State.line_height
 --?       print('=> y', y)
     elseif line.mode == 'drawing' then
       y = y+Drawing_padding_top
diff --git a/text.lua b/text.lua
index 4d20deb..709a676 100644
--- a/text.lua
+++ b/text.lua
@@ -2,7 +2,7 @@
 Text = {}
 
 -- 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
+-- return y for the next line, and position of start of final screen line drawn
 function Text.draw(State, line_index, y, startpos)
 --?   print('text.draw', line_index, y)
   local line = State.lines[line_index]
@@ -50,7 +50,7 @@ function Text.draw(State, line_index, y, startpos)
       end
     end
   end
-  return y - State.line_height, final_screen_line_starting_pos
+  return y, final_screen_line_starting_pos
 end
 
 function Text.screen_line(line, line_cache, i)