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-12 21:58:46 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-12 21:58:46 -0700
commit70a15b3bc91283f730d8388fdeaa7e6330f930be (patch)
treeda52835b43233e14847016f5a885d7fc485e7737 /text.lua
parent307e875c1c7cee60e3a07e3d7bf4f2bf79066d02 (diff)
downloadtext.love-70a15b3bc91283f730d8388fdeaa7e6330f930be.tar.gz
replace globals with args in a few functions
  - Drawing.draw_shape
  - Drawing.draw_pending_shape
  - Drawing.in_drawing
  - Drawing.find_or_insert_point
  - Drawing.near
  - Drawing.pixels
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/text.lua b/text.lua
index d3bbbe7..c07755e 100644
--- a/text.lua
+++ b/text.lua
@@ -363,7 +363,7 @@ function Text.pageup(State)
     if State.lines[State.screen_top1.line].mode == 'text' then
       y = y - State.line_height
     elseif State.lines[State.screen_top1.line].mode == 'drawing' then
-      y = y - State.drawing_padding_height - Drawing.pixels(State.lines[State.screen_top1.line].h)
+      y = y - State.drawing_padding_height - Drawing.pixels(State.lines[State.screen_top1.line].h, State.width)
     end
     top2 = Text.previous_screen_line(State, top2)
   end
@@ -641,7 +641,7 @@ function Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necess
       break
     end
 --?     print('cursor skips', State.cursor1.line)
-    y = y + State.drawing_padding_height + Drawing.pixels(State.lines[State.cursor1.line].h)
+    y = y + State.drawing_padding_height + Drawing.pixels(State.lines[State.cursor1.line].h, State.width)
     State.cursor1.line = State.cursor1.line + 1
   end
   -- hack: insert a text line at bottom of file if necessary
@@ -677,7 +677,7 @@ function Text.snap_cursor_to_bottom_of_screen(State)
       assert(State.lines[top2.line-1].mode == 'drawing')
       -- We currently can't draw partial drawings, so either skip it entirely
       -- or not at all.
-      local h = State.drawing_padding_height + Drawing.pixels(State.lines[top2.line-1].h)
+      local h = State.drawing_padding_height + Drawing.pixels(State.lines[top2.line-1].h, State.width)
       if y - h < State.top then
         break
       end