diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-16 08:48:02 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-16 08:48:02 -0700 |
commit | f61d4269f50fa317f02fc2195baa4bd758aee525 (patch) | |
tree | 385bde08a48221d338c2e7df3abedee787836651 /text.lua | |
parent | c26b377ab3455a2c5b90ec0fa34fce11b271bf72 (diff) | |
download | text.love-f61d4269f50fa317f02fc2195baa4bd758aee525.tar.gz |
bring back a set of constants
It's starting to sink in that I don't want hard-coded constants inside objects.
Diffstat (limited to 'text.lua')
-rw-r--r-- | text.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/text.lua b/text.lua index c07755e..d4bfbc2 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, State.width) + y = y - 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, State.width) + y = y + 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, State.width) + local h = Drawing_padding_height + Drawing.pixels(State.lines[top2.line-1].h, State.width) if y - h < State.top then break end |