bugfix: don't rely on Screen_bottom1 while scrolling

[?]
May 23, 2022, 3:52 PM
U7M4M2F7P5TGLTHKQ7J72GQFNPBII4PLJVJ44YVVOYEI4KPUDI6AC

Dependencies

  • [2] YTSPVDZH first successful pagedown test, first bug found by test
  • [3] 242L3OQX bugfix: ensure Cursor_line is always on a text line
  • [4] BYG5CEMV support for naming points
  • [5] QYIFOHW3 first test!
  • [6] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [7] 3QNOKBFM beginnings of a test harness
  • [8] PFT5Y2ZY move
  • [9] DLQMM265 scroll past first page
  • [10] AVTNUQYR basic test-enabled framework
  • [*] BULPIBEG beginnings of a module for the text editor
  • [*] 3TFEAQSW start using some globals
  • [*] OTIBCAUJ love2d scaffold
  • [*] 7IKRRESB longer names for indices in long loops
  • [*] IRV65LZP fold variables for screen dimensions into the app framework
  • [*] CVGE3SIG I feel confident now that page-down is working.

Change contents

  • edit in text.lua at line 12
    [13.50]
    [12.109]
    print('text.draw')
  • replacement in text.lua at line 130
    [2.1173][2.1173:1336]()
    App.screen.init{width=50, height=45}
    Lines = load_array{'abc',
    '```lines', '```',
    'def',
    'ghi'}
    [2.1173]
    [2.1336]
    App.screen.init{width=50, height=80}
    Lines = load_array{'abc', -- height 15
    '```lines', '```', -- height 25
    'def', -- height 15
    'ghi'} -- height 15
  • replacement in text.lua at line 142
    [2.1590][2.1590:1722]()
    local drawing_height = App.screen.width / 2 -- default
    -- initially the screen displays the first line and part of the drawing
    [2.1590]
    [2.1722]
    local text height = 15
    local drawing_height = 20 + App.screen.width / 2 -- default
    -- initially the screen displays the first line and the drawing
    -- 15px margin + 15px line1 + 10px margin + 25px drawing + 10px margin = 75px < screen height 80px
  • edit in text.lua at line 150
    [2.1902]
    [2.1902]
    -- 15px margin + 10px margin + 25px drawing + 10px margin + 15px line3 = 75px < screen height 80px
  • edit in text.lua at line 152
    [2.1939]
    [2.1939]
    print('test: top:', Screen_top1.line)
  • edit in text.lua at line 155
    [2.2053][2.2053:2148]()
    y = y + line_height
    App.screen.check(y, 'ghi', 'F - test_pagedown_skip_drawings/screen:2')
  • edit in text.lua at line 424
    [3.87]
    [3.6682]
    local y = 15 -- top margin
  • edit in text.lua at line 429
    [3.186]
    [3.6764]
    print('cursor skips', Cursor1.line)
    y = y + 20 + Drawing.pixels(Lines[Cursor1.line].h)
  • replacement in text.lua at line 438
    [3.408][3.6871:6916]()
    if Cursor1.line > Screen_bottom1.line then
    [3.408]
    [2.2154]
    --? print(y, App.screen.height, App.screen.height-math.floor(15*Zoom))
    if y > App.screen.height - math.floor(15*Zoom) then
    --? if Cursor1.line > Screen_bottom1.line then
  • edit in main.lua at line 125
    [15.44]
    [2.2297]
    print(y, line_index, line)
  • edit in main.lua at line 128
    [16.404]
    [3.9247]
    print('a')
  • edit in main.lua at line 231
    [3.1627][2.2495:2544]()
    print('setting top to', Screen_bottom1.line)
  • edit in main.lua at line 233
    [17.562]
    [3.9557]
    print('setting top to', Screen_top1.line)
  • edit in main.lua at line 237
    [3.1020]
    [3.1721]
    print('top now', Screen_top1.line)
  • replacement in app.lua at line 96
    [3.4434][2.2843:2885]()
    -- App.run_after_keypress('pagedown')
    [3.4434]
    [3.4475]
    -- App.run_after_keychord('pagedown')