done passing left/right margins everywhere

[?]
Jul 8, 2022, 11:30 PM
NDHQN23GI2IFUYGNYSO4BC467L37CQDDYL4C7NYCLD47QHOG6WFQC

Dependencies

  • [2] 5DOTWNVM right margin
  • [3] MDXGMZU2 disable all debug prints
  • [4] 4VKEE43Z bugfix
  • [5] BYG5CEMV support for naming points
  • [6] CVGE3SIG I feel confident now that page-down is working.
  • [7] PFT5Y2ZY move
  • [8] 5FW7YOFT highlight selection while dragging
  • [9] U52E2XZN fix a crash
  • [10] DGK5BPVI bugfix: UTF-8 in compute_fragments
  • [11] M6TH7VSZ rip out notion of Line_width
  • [12] P66MRF3U bugfix: don't append metadata when it already exists
  • [13] LERERVPH keep one screen line of overlap on pagedown
  • [14] LXTTOB33 extract a couple of files
  • [15] XNFTJHC4 split keyboard handling between Text and Drawing
  • [16] QYIFOHW3 first test!
  • [17] IMEJA43L snapshot
  • [18] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [19] R53OF3ON one bug I've repeatedly run into while testing with Moby Dick
  • [20] LAW2O3NW extract variable Margin_left
  • [21] K4OBZSHE add args to some functions
  • [22] PESSMQBJ no, make sure to compute line width after screen dimensions
  • [23] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [24] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [25] 5DOC2CBM extract a function
  • [26] HOSPP2AN crisp font rendering
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • replacement in text.lua at line 23
    [3.1850][3.743:776]()
    Text.compute_fragments(line)
    [3.1850]
    [3.103]
    Text.compute_fragments(line, left, right)
  • replacement in text.lua at line 96
    [3.42][3.1120:1158](),[3.1158][2.3739:3803]()
    function Text.compute_fragments(line)
    --? print('compute_fragments', App.screen.width-Margin_right)
    [3.42]
    [3.51]
    function Text.compute_fragments(line, left, right)
    --? print('compute_fragments', right)
  • replacement in text.lua at line 99
    [3.73][3.2279:2303]()
    local x = Margin_left
    [3.73]
    [3.88]
    local x = left
  • replacement in text.lua at line 104
    [3.2940][2.3804:3899]()
    --? print('x: '..tostring(x)..'; '..tostring(App.screen.width-Margin_right-x)..'px to go')
    [3.2940]
    [3.380]
    --? print('x: '..tostring(x)..'; '..tostring(right-x)..'px to go')
  • replacement in text.lua at line 106
    [3.453][2.3900:4219]()
    if x + frag_width > App.screen.width-Margin_right then
    while x + frag_width > App.screen.width-Margin_right do
    --? print(x, frag, frag_width, App.screen.width-Margin_right)
    if x < 0.8*(App.screen.width-Margin_right) then
    --? print(frag, x, frag_width, App.screen.width-Margin_right)
    [3.453]
    [3.571]
    if x + frag_width > right then
    while x + frag_width > right do
    --? print(x, frag, frag_width, right)
    if x < 0.8*right then
    --? print(frag, x, frag_width, right)
  • replacement in text.lua at line 113
    [3.672][2.4220:4311]()
    local bpos = Text.nearest_pos_less_than(frag, App.screen.width-Margin_right - x)
    [3.672]
    [3.833]
    local bpos = Text.nearest_pos_less_than(frag, right - x)
  • replacement in text.lua at line 120
    [3.2993][2.4312:4452]()
    --? print(frag, x, frag1_width, App.screen.width-Margin_right)
    assert(x + frag1_width <= App.screen.width-Margin_right)
    [3.2993]
    [3.998]
    --? print(frag, x, frag1_width, right)
    assert(x + frag1_width <= right)
  • replacement in text.lua at line 128
    [3.1339][3.2304:2341]()
    x = Margin_left -- new line
    [3.1339]
    [3.1367]
    x = left -- new line
  • replacement in text.lua at line 677
    [3.35][3.1811:1844]()
    Text.compute_fragments(line)
    [3.35]
    [3.80]
    Text.compute_fragments(line, left, right)
  • replacement in text.lua at line 902
    [3.2315][3.1845:1878]()
    Text.compute_fragments(line)
    [3.2315]
    [3.2360]
    Text.compute_fragments(line, left, right)