stop caching starty

akkartik
Jun 11, 2024, 5:39 PM
2TCIWW6ZC73FHPZLO5QOBUFZCIL74U2MBYTPNXFYYFJ7IH4YAGUQC

Dependencies

  • [2] FNJF2FMQ bugfix: online help
  • [3] YRJFJNUD bugfix
  • [4] ZS5IYZH5 stop caching screen_bottom1
  • [5] LNUHQOGH start passing in Editor_state explicitly
  • [6] KOTNETIM repeat changes on source editor
  • [7] WJBZZQE4 fold together two largely similar cases
  • [8] 6XCJX4DZ bugfix: inscript's bug
  • [9] SRVDX4I5 local var
  • [10] DLQMM265 scroll past first page
  • [11] 2CK5QI7W make love event names consistent
  • [12] ZLJGZYQG select text with shift + mouseclick
  • [13] LUNH47XX make text and drawings the same width
  • [14] 65HNIAOS make freehand drawings smoother
  • [15] 5UKUADTW distinguish consistently between mouse buttons and other buttons
  • [16] CWQIPU7U always show line numbers in source editor
  • [17] HOSPP2AN crisp font rendering
  • [18] OWK3U6VD tests for drawing polygons
  • [19] JYB3RFWH bugfix in source editor
  • [20] RMKMPFT5 fix a corner case when selecting text
  • [21] AH744RFR show when we're naming a point
  • [22] MTJEVRJR add state arg to a few functions
  • [23] CUFW4EJL reorganize app.lua and its comments
  • [24] 3HVBAZPA add state arg to a few functions
  • [25] ODLKHO7B switch to line index in a function
  • [26] BXJMGTV2 hoist couple of variables out
  • [27] WTDKUACN rectangle and square shapes
  • [28] DLQAEAC7 add state arg to Drawing.mouse_pressed
  • [29] 3OTESDW6 move drawing.starty into line cache
  • [30] QXVD2RIF add state arg to Drawing.mouse_released
  • [31] 5DOTWNVM right margin
  • [32] FKNXK2OA switch to line index in a function
  • [33] TGHAJBES use line cache for drawings as well
  • [34] K2X6G75Z start writing some tests for drawings
  • [35] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [36] PJEQCTBL add state arg to Drawing.update
  • [37] OI4FPFIN support drawings in the source editor
  • [38] 4PHGNJN6 assume starty can be nil in update
  • [39] LXTTOB33 extract a couple of files
  • [40] B4JEWKWI hide editor cursor while in file navigator
  • [41] BYG5CEMV support for naming points
  • [42] LAW2O3NW extract variable Margin_left
  • [43] 3RGHOJ25 DRY some code
  • [44] S2MISTTM add state arg to a few functions
  • [45] EHSUSZMK more idiomatic variable names
  • [46] 54HEXCWV clearer API for drawing a button
  • [47] JAXPXLEB set current_drawing_index with current_drawing
  • [48] 5SM6DRHK port inscript's bugfix to source editor
  • [49] C45WCXJ2 keep drawings within the line width slider as well
  • [50] 23MA4T3G add state arg to Drawing.keychord_pressed
  • [51] RT6EV6OP delegate update events to drawings
  • [52] YCDYGEZU include drawing index in a few places
  • [53] HVJKBW5U drop some unnecessary calls
  • [54] PNHUONCT update documentation on fragments
  • [55] QCPXQ2E3 add state arg to a few functions
  • [56] IFTYOERM line.y -> line_cache.starty in a few more places
  • [57] ORRSP7FV deduce test names on failures
  • [58] 6RYLD5ON change how we handle clicks above top margin
  • [59] M6TH7VSZ rip out notion of Line_width
  • [60] PXSQR2AD hide line numbers from log browser
  • [61] P5QNVXSN drop final mention of state global beyond main.lua
  • [62] PTDO2SOT add state arg to schedule_save
  • [63] QAMVLUK2 fix a crash involving mouse and drawings
  • [64] W2CQ7YNG more chunks, same approach
  • [65] VHQCNMAR several more modules
  • [66] 3ZSUBI57 drop some redundant args from Text.draw
  • [67] L6XA5EY2 test: moving a point
  • [68] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [69] 6DE7RBZ6 move mouse_released events to Drawing
  • [70] 4KC7I3E2 make colors easier to edit
  • [71] KKMFQDR4 editing source code from within the app
  • [72] FFBIY74N bugfix: 'escape' to cancel a stroke
  • [73] G54H3YG2 get rid of all bifold text
  • [74] DRFE3B3Z mouse buttons are integers, not strings
  • [75] 2L5MEZV3 experiment: new edit namespace
  • [76] GDAWPFAV more streamlined test names
  • [77] R3XGABER chunk up some long lines
  • [78] FZCKGO2I make local functions look different
  • [79] UHB4GARJ left/right margin -> left/right coordinates
  • [80] MXA3RZYK deduce left/right from state where possible
  • [81] YJGADSGK delete unused arg
  • [82] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [83] EM276IH3 make a function oblivious to line data structure
  • [84] C6QTJYA4 keep online help inside of drawing
  • [85] JFFUF5AL override mouse state lookups in tests
  • [86] CRYGI3LR more drawing tests
  • [87] QFC3WRDZ chunking by simple local variable
  • [88] LF7BWEG4 group all editor globals
  • [89] ILOA5BYF separate data structure for each line's cache data
  • [90] 5BMR5HRT click to the left of a line
  • [91] 7JH2ZT3F add state arg to Drawing.draw
  • [92] KMSL74GA support selections in the source editor
  • [93] EKKFWP4D bugfix: couple of margin-relative computations
  • [94] MYC7XR5Q bugfix: lines that aren't drawn from the start
  • [95] NYQ7HD4D move
  • [96] P4376EXK add state arg to few functions
  • [97] P6SYWBLB remove a duplicate test
  • [98] KTZQ57HV replace globals with args in a few functions
  • [99] WAR3HXHT test both ways of selecting text with mouse
  • [100] LIKTH6HM update stale source X-(
  • [101] BLWAYPKV extract a module
  • [102] XNFTJHC4 split keyboard handling between Text and Drawing
  • [103] NHA7RUFI move current mode indicator slightly
  • [104] 52ZZ5TIE switch to line index in a function
  • [105] KYNGDE2C consistent names in a few more places
  • [106] SPSW74Y5 add state arg to Text.keychord_pressed
  • [107] LYN3L74W correct commit f3abc2cbf2
  • [108] G3DLS5OU audit all asserts
  • [*] BULPIBEG beginnings of a module for the text editor
  • [*] 3QNOKBFM beginnings of a test harness

Change contents

  • replacement in text_tests.lua at line 258
    [5.171][5.171:266]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.171]
    [5.266]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line Editor_state.line_cache
  • replacement in text_tests.lua at line 815
    [5.20197][5.337:432]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.20197]
    [5.2]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line Editor_state.line_cache
  • replacement in text_tests.lua at line 834
    [5.497][5.497:592]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.497]
    [5.592]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line
  • replacement in text_tests.lua at line 893
    [5.21125][5.433:528]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.21125]
    [5.581]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line
  • replacement in text_tests.lua at line 917
    [5.22267][5.529:624]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.22267]
    [5.446]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line
  • edit in text.lua at line 10
    [5.53][5.3763:3787](),[5.3763][5.3763:3787]()
    line_cache.starty = y
  • edit in text.lua at line 357
    [4.659]
    [4.659]
    end
    -- return the top y coordinate of a given line_index,
    -- or nil if no part of it is on screen
    function Text.starty(State, line_index)
    -- duplicate some logic from love.draw
    -- does not modify State (except to populate line_cache)
    if line_index < State.screen_top1.line then return end
    local loc2 = Text.to2(State, State.screen_top1)
    local y = State.top
    while true do
    if State.lines[loc2.line].mode == 'drawing' then
    y = y + Drawing_padding_top
    end
    if loc2.line == line_index then return y end
    if State.lines[loc2.line].mode == 'text' then
    y = y + State.line_height
    elseif State.lines[loc2.line].mode == 'drawing' then
    y = y + Drawing.pixels(State.lines[loc2.line].h, State.width) + Drawing_padding_bottom
    end
    if y + State.line_height > App.screen.height then break end
    local next_loc2 = Text.next_screen_line(State, loc2)
    if Text.eq2(next_loc2, loc2) then break end -- end of file
    loc2 = next_loc2
    end
  • replacement in text.lua at line 764
    [5.1027][5.5239:5316](),[5.5239][5.5239:5316](),[5.2967][5.5317:5366]()
    if line_cache.starty == nil then return false end -- outside current page
    if y < line_cache.starty then return false end
    [5.1027]
    [5.421]
    local starty = Text.starty(State, line_index)
    if starty == nil then return false end -- outside current page
    if y < starty then return false end
  • replacement in text.lua at line 768
    [5.481][5.5367:5544]()
    return y < line_cache.starty + State.line_height*(#line_cache.screen_line_starting_pos - Text.screen_line_index(line_cache.screen_line_starting_pos, line_cache.startpos) + 1)
    [5.481]
    [5.95]
    return y < starty + State.line_height*(#line_cache.screen_line_starting_pos - Text.screen_line_index(line_cache.screen_line_starting_pos, line_cache.startpos) + 1)
  • replacement in text.lua at line 775
    [5.1078][5.1933:2000]()
    assert(my >= line_cache.starty, 'failed to map y pixel to line')
    [5.1078]
    [5.863]
    local starty = Text.starty(State, line_index)
    assert(my >= starty, 'failed to map y pixel to line')
  • replacement in text.lua at line 778
    [5.904][5.5674:5704]()
    local y = line_cache.starty
    [5.904]
    [5.5704]
    local y = starty
  • replacement in source_text_tests.lua at line 258
    [5.250][5.250:345]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.250]
    [5.345]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line
  • replacement in source_text_tests.lua at line 815
    [5.8436][5.8436:8531]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.8436]
    [5.8531]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line
  • replacement in source_text_tests.lua at line 834
    [5.509][5.509:604]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.509]
    [5.604]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line
  • replacement in source_text_tests.lua at line 893
    [5.9604][5.9604:9699]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.9604]
    [5.9699]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line
  • replacement in source_text_tests.lua at line 917
    [5.11105][5.11105:11200]()
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
    [5.11105]
    [5.11200]
    edit.draw(Editor_state) -- populate line_cache.startpos for each line
  • edit in source_text.lua at line 9
    [5.84187][5.84187:84211]()
    line_cache.starty = y
  • edit in source_text.lua at line 433
    [4.4556]
    [4.4556]
    -- return the top y coordinate of a given line_index,
    -- or nil if no part of it is on screen
    function Text.starty(State, line_index)
    -- duplicate some logic from love.draw
    -- does not modify State (except to populate line_cache)
    if line_index < State.screen_top1.line then return end
    local loc2 = Text.to2(State, State.screen_top1)
    local y = State.top
    while true do
    if loc2.line == line_index then return y end
    if State.lines[loc2.line].mode == 'text' then
    y = y + State.line_height
    elseif State.lines[loc2.line].mode == 'drawing' then
    y = y + Drawing_padding_height + Drawing.pixels(State.lines[loc2.line].h, State.width)
    end
    if y + State.line_height > App.screen.height then break end
    local next_loc2 = Text.next_screen_line(State, loc2)
    if Text.eq2(next_loc2, loc2) then break end -- end of file
    loc2 = next_loc2
    end
    end
  • replacement in source_text.lua at line 835
    [5.128822][5.128822:128948]()
    if line_cache.starty == nil then return false end -- outside current page
    if y < line_cache.starty then return false end
    [5.128822]
    [5.4081]
    local starty = Text.starty(State, line_index)
    if starty == nil then return false end -- outside current page
    if y < starty then return false end
  • replacement in source_text.lua at line 839
    [5.4141][5.4141:4318]()
    return y < line_cache.starty + State.line_height*(#line_cache.screen_line_starting_pos - Text.screen_line_index(line_cache.screen_line_starting_pos, line_cache.startpos) + 1)
    [5.4141]
    [5.130218]
    return y < starty + State.line_height*(#line_cache.screen_line_starting_pos - Text.screen_line_index(line_cache.screen_line_starting_pos, line_cache.startpos) + 1)
  • replacement in source_text.lua at line 846
    [5.130885][5.4251:4318]()
    assert(my >= line_cache.starty, 'failed to map y pixel to line')
    [5.130885]
    [5.130919]
    local starty = Text.starty(State, line_index)
    assert(my >= starty, 'failed to map y pixel to line')
  • replacement in source_text.lua at line 849
    [5.130960][5.130960:130990]()
    local y = line_cache.starty
    [5.130960]
    [5.4319]
    local y = starty
  • edit in source_edit.lua at line 36
    [5.18706][5.18706:18771]()
    -- a (y) coord in pixels (updated while painting screen),
  • edit in source_edit.lua at line 56
    [5.153505][5.153505:153575]()
    -- starty, the y coord in pixels the line starts rendering from
  • edit in source_edit.lua at line 190
    [5.20733][5.947:1046]()
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end
  • replacement in source_edit.lua at line 280
    [5.21906][5.21906:22041]()
    local line_cache = State.line_cache[line_index]
    if Drawing.in_drawing(line, line_cache, x, y, State.left,State.right) then
    [5.21906]
    [5.22041]
    if Drawing.in_drawing(State, line_index, x, y, State.left,State.right) then
  • edit in source_edit.lua at line 398
    [5.158174][3.11:118]()
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
  • edit in source_edit.lua at line 502
    [5.23303][5.23303:23345]()
    -- DON'T reset line_cache.starty here
  • edit in source_edit.lua at line 538
    [5.163128][5.163128:163235]()
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
  • edit in source.lua at line 310
    [5.448][5.175329:175443](),[5.175329][5.175329:175443]()
    for _,line_cache in ipairs(Editor_state.line_cache) do line_cache.starty = nil end -- just in case we scroll
  • replacement in select.lua at line 72
    [5.1839][5.909:971](),[5.4181][5.909:971]()
    if y < State.line_cache[State.screen_top1.line].starty then
    [5.1839]
    [5.971]
    if y < State.top then
  • replacement in help.lua at line 3
    [2.120][2.120:173]()
    local line_cache = State.line_cache[drawing_index]
    [2.120]
    [5.289]
    local starty = Text.starty(State, drawing_index)
  • replacement in help.lua at line 5
    [5.313][2.174:207]()
    local y = line_cache.starty+10
    [5.313]
    [5.18377]
    local y = starty+10
  • replacement in help.lua at line 51
    [5.349][2.208:355]()
    love.graphics.rectangle('fill', State.left,line_cache.starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-line_cache.starty))
    [5.349]
    [5.8578]
    love.graphics.rectangle('fill', State.left,starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-starty))
  • replacement in help.lua at line 56
    [2.461][2.461:514]()
    local line_cache = State.line_cache[drawing_index]
    [2.461]
    [5.350]
    local starty = Text.starty(State, drawing_index)
  • replacement in help.lua at line 58
    [5.374][2.515:548]()
    local y = line_cache.starty+10
    [5.374]
    [5.19962]
    local y = starty+10
  • replacement in help.lua at line 132
    [5.410][2.549:696]()
    love.graphics.rectangle('fill', State.left,line_cache.starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-line_cache.starty))
    [5.410]
    [5.10910]
    love.graphics.rectangle('fill', State.left,starty, State.width, math.max(Drawing.pixels(drawing.h, State.width),y-starty))
  • edit in edit.lua at line 34
    [5.94979][5.94979:95044]()
    -- a (y) coord in pixels (updated while painting screen),
  • edit in edit.lua at line 54
    [5.7961][5.7961:8031]()
    -- starty, the y coord in pixels the line starts rendering from
  • edit in edit.lua at line 185
    [5.1966][5.935:1034]()
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end
  • replacement in edit.lua at line 276
    [5.8089][5.57:192]()
    local line_cache = State.line_cache[line_index]
    if Drawing.in_drawing(line, line_cache, x, y, State.left,State.right) then
    [5.8089]
    [5.5145]
    if Drawing.in_drawing(State, line_index, x, y, State.left,State.right) then
  • edit in edit.lua at line 394
    [5.6985][3.134:241]()
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
  • edit in edit.lua at line 498
    [5.14561][5.1250:1292]()
    -- DON'T reset line_cache.starty here
  • edit in edit.lua at line 534
    [5.15878][5.1293:1400]()
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
  • replacement in drawing_tests.lua at line 35
    [5.48768][5.48768:48866]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.48768]
    [5.48866]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • replacement in drawing_tests.lua at line 80
    [5.49651][5.49651:49749]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.49651]
    [5.49749]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • replacement in drawing_tests.lua at line 108
    [5.50255][5.50255:50353]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.50255]
    [5.50353]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • replacement in drawing_tests.lua at line 137
    [5.50865][5.50865:50963]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.50865]
    [5.50963]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • replacement in drawing_tests.lua at line 175
    [5.51319][5.51319:51417]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.51319]
    [5.51417]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • replacement in drawing_tests.lua at line 203
    [5.51929][5.51929:52027]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.51929]
    [5.52027]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • replacement in drawing_tests.lua at line 234
    [5.52698][5.52698:52796]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.52698]
    [5.52796]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • replacement in drawing_tests.lua at line 272
    [5.53464][5.53464:53562]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.53464]
    [5.53562]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • replacement in drawing_tests.lua at line 316
    [5.54331][5.54331:54429]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.54331]
    [5.54429]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • replacement in drawing_tests.lua at line 352
    [5.55046][5.55046:55144]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
    [5.55046]
    [5.55144]
    check_eq(Text.starty(Editor_state, 1), Editor_state.top+Drawing_padding_top, 'baseline/y')
  • edit in drawing.lua at line 9
    [5.1584][5.1584:1658]()
    local line_cache = State.line_cache[line_index]
    line_cache.starty = y
  • replacement in drawing.lua at line 10
    [5.1580][5.1659:1779]()
    if pmx < State.right and pmy > line_cache.starty and pmy < line_cache.starty+Drawing.pixels(line.h, State.width) then
    [5.1580]
    [5.1026]
    local starty = Text.starty(State, line_index)
    if pmx < State.right and pmy > starty and pmy < starty+Drawing.pixels(line.h, State.width) then
  • replacement in drawing.lua at line 13
    [5.1052][5.1780:1895]()
    love.graphics.rectangle('line', State.left,line_cache.starty, State.width,Drawing.pixels(line.h, State.width))
    [5.1052]
    [5.318]
    love.graphics.rectangle('line', State.left,starty, State.width,Drawing.pixels(line.h, State.width))
  • replacement in drawing.lua at line 15
    [5.363][5.1896:1972]()
    icon[State.current_drawing_mode](State.right-22, line_cache.starty+4)
    [5.363]
    [5.523]
    icon[State.current_drawing_mode](State.right-22, starty+4)
  • replacement in drawing.lua at line 17
    [5.532][5.1973:2050]()
    icon[State.previous_drawing_mode](State.right-22, line_cache.starty+4)
    [5.532]
    [5.589]
    icon[State.previous_drawing_mode](State.right-22, starty+4)
  • replacement in drawing.lua at line 32
    [5.73][5.2051:2114]()
    local my = Drawing.coord(pmy-line_cache.starty, State.width)
    [5.73]
    [5.894]
    local my = Drawing.coord(pmy-starty, State.width)
  • replacement in drawing.lua at line 40
    [5.1083][5.2115:2194]()
    Drawing.draw_shape(line, shape, line_cache.starty, State.left,State.right)
    [5.1083]
    [5.1122]
    Drawing.draw_shape(line, shape, starty, State.left,State.right)
  • replacement in drawing.lua at line 44
    [5.93][5.2195:2278]()
    local function py(y) return Drawing.pixels(y, State.width)+line_cache.starty end
    [5.93]
    [5.10]
    local function py(y) return Drawing.pixels(y, State.width)+starty end
  • replacement in drawing.lua at line 73
    [5.1279][5.2279:2357]()
    Drawing.draw_pending_shape(line, line_cache.starty, State.left,State.right)
    [5.1279]
    [5.10]
    Drawing.draw_pending_shape(line, starty, State.left,State.right)
  • replacement in drawing.lua at line 211
    [5.646][5.2358:2501]()
    function Drawing.in_drawing(drawing, line_cache, x,y, left,right)
    if line_cache.starty == nil then return false end -- outside current page
    [5.646]
    [5.5435]
    function Drawing.in_current_drawing(State, x,y, left,right)
    return Drawing.in_drawing(State, State.lines.current_drawing_index, x,y, left,right)
    end
    function Drawing.in_drawing(State, line_index, x,y, left,right)
    assert(State.lines[line_index].mode == 'drawing')
    local starty = Text.starty(State, line_index)
    if starty == nil then return false end -- outside current page
    local drawing = State.lines[line_index]
  • replacement in drawing.lua at line 221
    [5.5462][5.2502:2623]()
    return y >= line_cache.starty and y < line_cache.starty + Drawing.pixels(drawing.h, width) and x >= left and x < right
    [5.5462]
    [5.795]
    return y >= starty and y < starty + Drawing.pixels(drawing.h, width) and x >= left and x < right
  • replacement in drawing.lua at line 226
    [5.2735][5.2735:2788]()
    local line_cache = State.line_cache[drawing_index]
    [5.2735]
    [5.17]
    local starty = Text.starty(State, drawing_index)
  • replacement in drawing.lua at line 228
    [5.71][5.2789:2850]()
    local cy = Drawing.coord(y-line_cache.starty, State.width)
    [5.71]
    [5.140]
    local cy = Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 253
    [5.179][5.2851:2924](),[5.2924][5.31:66]()
    local line_cache = State.line_cache[State.lines.current_drawing_index]
    if line_cache.starty == nil then
    [5.179]
    [5.66]
    local starty = Text.starty(State, State.lines.current_drawing_index)
    if starty == nil then
  • replacement in drawing.lua at line 263
    [5.134][5.2925:2988]()
    local my = Drawing.coord(pmy-line_cache.starty, State.width)
    [5.134]
    [5.1585]
    local my = Drawing.coord(pmy-starty, State.width)
  • replacement in drawing.lua at line 265
    [5.1613][5.2989:3074]()
    if Drawing.in_drawing(drawing, line_cache, pmx,pmy, State.left,State.right) then
    [5.1613]
    [5.384]
    if Drawing.in_current_drawing(State, pmx,pmy, State.left,State.right) then
  • replacement in drawing.lua at line 275
    [5.457][5.3075:3161]()
    if Drawing.in_drawing(drawing, line_cache, pmx, pmy, State.left,State.right) then
    [5.457]
    [5.949]
    if Drawing.in_current_drawing(State, pmx, pmy, State.left,State.right) then
  • replacement in drawing.lua at line 313
    [5.487][5.3162:3237]()
    local line_cache = State.line_cache[State.lines.current_drawing_index]
    [5.487]
    [5.46]
    local starty = Text.starty(State, State.lines.current_drawing_index)
  • replacement in drawing.lua at line 322
    [5.227][5.3238:3350]()
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    [5.227]
    [5.297]
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 329
    [5.627][5.3351:3463]()
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    [5.627]
    [5.697]
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 337
    [5.1032][5.3464:3588]()
    App.mouse_move(State.left+Drawing.pixels(p2.x, State.width), line_cache.starty+Drawing.pixels(p2.y, State.width))
    [5.1032]
    [5.1122]
    App.mouse_move(State.left+Drawing.pixels(p2.x, State.width), starty+Drawing.pixels(p2.y, State.width))
  • replacement in drawing.lua at line 341
    [5.1231][5.3589:3701]()
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    [5.1231]
    [5.1301]
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 349
    [5.1668][5.3702:3816]()
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    [5.1668]
    [5.1740]
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 364
    [5.2366][5.3817:3931]()
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    [5.2366]
    [5.2438]
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 375
    [5.2970][5.3932:4044]()
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    [5.2970]
    [5.3040]
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 382
    [5.3348][5.4045:4157]()
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    [5.3348]
    [5.3418]
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 486
    [5.690][5.4158:4354]()
    local _,drawing,line_cache = Drawing.current_drawing(State)
    local mx,my = Drawing.coord(App.mouse_x()-State.left, State.width), Drawing.coord(App.mouse_y()-line_cache.starty, State.width)
    [5.690]
    [5.7883]
    local drawing_index,drawing = Drawing.current_drawing(State)
    local starty = Text.starty(State, drawing_index)
    local mx,my = Drawing.coord(App.mouse_x()-State.left, State.width), Drawing.coord(App.mouse_y()-starty, State.width)
  • replacement in drawing.lua at line 492
    [5.936][5.4355:4551]()
    local _,drawing,line_cache = Drawing.current_drawing(State)
    local mx,my = Drawing.coord(App.mouse_x()-State.left, State.width), Drawing.coord(App.mouse_y()-line_cache.starty, State.width)
    [5.936]
    [5.7963]
    local drawing_index,drawing = Drawing.current_drawing(State)
    local starty = Text.starty(State, drawing_index)
    local mx,my = Drawing.coord(App.mouse_x()-State.left, State.width), Drawing.coord(App.mouse_y()-starty, State.width)
  • replacement in drawing.lua at line 503
    [5.1177][5.4552:4616]()
    local _,drawing,line_cache = Drawing.current_drawing(State)
    [5.1177]
    [5.7225]
    local drawing_index,drawing = Drawing.current_drawing(State)
    local starty = Text.starty(State, drawing_index)
  • replacement in drawing.lua at line 506
    [5.7258][5.4617:4749]()
    local mx,my = Drawing.coord(App.mouse_x()-State.left, State.width), Drawing.coord(App.mouse_y()-line_cache.starty, State.width)
    [5.7258]
    [5.7414]
    local mx,my = Drawing.coord(App.mouse_x()-State.left, State.width), Drawing.coord(App.mouse_y()-starty, State.width)
  • replacement in drawing.lua at line 522
    [5.2665][5.4750:4836]()
    local drawing_index,drawing,line_cache,i,p = Drawing.select_point_at_mouse(State)
    [5.2665]
    [5.10152]
    local drawing_index,drawing,_,i,p = Drawing.select_point_at_mouse(State)
  • replacement in drawing.lua at line 533
    [5.2771][5.4837:4933]()
    local drawing_index,drawing,line_cache,point_index,p = Drawing.select_point_at_mouse(State)
    [5.2771]
    [5.1952]
    local drawing_index,drawing,_,point_index,p = Drawing.select_point_at_mouse(State)
  • replacement in drawing.lua at line 631
    [5.19238][5.5068:5256]()
    local line_cache = State.line_cache[drawing_index]
    if Drawing.in_drawing(drawing, line_cache, x,y, State.left,State.right) then
    return drawing_index,drawing,line_cache
    [5.19238]
    [5.19373]
    if Drawing.in_drawing(State, drawing_index, x,y, State.left,State.right) then
    return drawing_index,drawing
  • replacement in drawing.lua at line 643
    [5.4159][5.5312:5564]()
    local line_cache = State.line_cache[drawing_index]
    if Drawing.in_drawing(drawing, line_cache, x,y, State.left,State.right) then
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    [5.4159]
    [5.19800]
    local starty = Text.starty(State, drawing_index)
    if Drawing.in_drawing(State, drawing_index, x,y, State.left,State.right) then
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 648
    [5.19928][5.5565:5611]()
    return drawing,line_cache,i,shape
    [5.19928]
    [5.19963]
    return drawing,starty,i,shape
  • replacement in drawing.lua at line 660
    [5.4208][5.5612:5864]()
    local line_cache = State.line_cache[drawing_index]
    if Drawing.in_drawing(drawing, line_cache, x,y, State.left,State.right) then
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    [5.4208]
    [5.20403]
    local starty = Text.starty(State, drawing_index)
    if Drawing.in_drawing(State, drawing_index, x,y, State.left,State.right) then
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-starty, State.width)
  • replacement in drawing.lua at line 665
    [5.8465][5.5865:5925]()
    return drawing_index,drawing,line_cache,i,point
    [5.8465]
    [5.20556]
    return drawing_index,drawing,starty,i,point
  • replacement in drawing.lua at line 677
    [5.4257][5.5981:6121]()
    local line_cache = State.line_cache[drawing_index]
    if Drawing.in_drawing(drawing, line_cache, x,y, State.left,State.right) then
    [5.4257]
    [5.20896]
    if Drawing.in_drawing(State, drawing_index, x,y, State.left,State.right) then
  • replacement in app.lua at line 134
    [4.8755][4.8755:8792]()
    --? test_pagedown_skips_drawings()
    [4.8755]
    [5.842]
    --? test_click_moves_cursor()