mouse wheel support

[?]
Mar 24, 2023, 4:00 AM
GFXWHTE6POBIOBUMRAWD5QS22JEO52EF4VTLMB4CDK4RLSCK7HCAC

Dependencies

  • [2] 2CK5QI7W make love event names consistent
  • [3] KKMFQDR4 editing source code from within the app
  • [*] KMSL74GA support selections in the source editor
  • [*] OI4FPFIN support drawings in the source editor
  • [*] OTIBCAUJ love2d scaffold
  • [*] 2L5MEZV3 experiment: new edit namespace
  • [*] LNUHQOGH start passing in Editor_state explicitly

Change contents

  • edit in source_edit.lua at line 305
    [5.32159]
    [6.22639]
    end
    end
    function edit.mouse_wheel_move(State, dx,dy)
    if dy > 0 then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    for i=1,math.floor(dy) do
    Text.up(State)
    end
    else
    State.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}
    for i=1,math.floor(-dy) do
    Text.down(State)
    end
  • edit in source.lua at line 326
    [3.175762]
    [2.3448]
    function source.mouse_wheel_move(dx,dy)
    Cursor_time = 0 -- ensure cursor is visible immediately after it moves
    if Focus == 'edit' then
    return edit.mouse_wheel_move(Editor_state, dx,dy)
    else
    return log_browser.mouse_wheel_move(Log_browser_state, dx,dy)
    end
    end
  • edit in run.lua at line 166
    [3.183379]
    [2.4163]
    function run.mouse_wheel_move(x,y)
    Cursor_time = 0 -- ensure cursor is visible immediately after it moves
    return edit.mouse_wheel_move(Editor_state, x,y)
    end
  • edit in main.lua at line 248
    [2.5101]
    [3.191200]
    else
    assert(false, 'unknown app "'..Current_app..'"')
    end
    end
    function App.wheelmoved(dx,dy)
    if Current_app == 'run' then
    if run.mouse_wheel_move then run.mouse_wheel_move(dx,dy) end
    elseif Current_app == 'source' then
    if source.mouse_wheel_move then source.mouse_wheel_move(dx,dy) end
  • edit in log_browser.lua at line 264
    [2.5164]
    [3.201426]
    end
    function log_browser.mouse_wheel_move(State, dx,dy)
    if dy > 0 then
    for i=1,math.floor(dy) do
    log_browser.up(State)
    end
    else
    for i=1,math.floor(-dy) do
    log_browser.down(State)
    end
    end
  • replacement in log_browser.lua at line 284
    [3.201568][3.201568:201759]()
    while State.screen_top1.line > 1 do
    State.screen_top1.line = State.screen_top1.line-1
    if should_show(State.lines[State.screen_top1.line]) then
    break
    end
    end
    [3.201568]
    [3.201759]
    log_browser.up(State)
  • replacement in log_browser.lua at line 286
    [3.201789][3.201789:201991]()
    while State.screen_top1.line < #State.lines do
    State.screen_top1.line = State.screen_top1.line+1
    if should_show(State.lines[State.screen_top1.line]) then
    break
    end
    end
    [3.201789]
    [3.201991]
    log_browser.down(State)
  • edit in log_browser.lua at line 302
    [3.202646]
    [3.202646]
    end
    end
    end
    function log_browser.up(State)
    while State.screen_top1.line > 1 do
    State.screen_top1.line = State.screen_top1.line-1
    if should_show(State.lines[State.screen_top1.line]) then
    break
  • edit in log_browser.lua at line 315
    [3.202665]
    [3.202665]
    function log_browser.down(State)
    while State.screen_top1.line < #State.lines do
    State.screen_top1.line = State.screen_top1.line+1
    if should_show(State.lines[State.screen_top1.line]) then
    break
    end
    end
    end
  • edit in edit.lua at line 304
    [9.6276]
    [8.9685]
    end
    end
    function edit.mouse_wheel_move(State, dx,dy)
    if dy > 0 then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    for i=1,math.floor(dy) do
    Text.up(State)
    end
    else
    State.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}
    for i=1,math.floor(-dy) do
    Text.down(State)
    end