mouse wheel support
[?]
Mar 24, 2023, 4:00 AM
GFXWHTE6POBIOBUMRAWD5QS22JEO52EF4VTLMB4CDK4RLSCK7HCACDependencies
- [2]
2CK5QI7Wmake love event names consistent - [3]
KKMFQDR4editing source code from within the app - [*]
KMSL74GAsupport selections in the source editor - [*]
OI4FPFINsupport drawings in the source editor - [*]
OTIBCAUJlove2d scaffold - [*]
2L5MEZV3experiment: new edit namespace - [*]
LNUHQOGHstart passing in Editor_state explicitly
Change contents
- edit in source_edit.lua at line 305
endendfunction edit.mouse_wheel_move(State, dx,dy)if dy > 0 thenState.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}for i=1,math.floor(dy) doText.up(State)endelseState.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}for i=1,math.floor(-dy) doText.down(State)end - edit in source.lua at line 326
function source.mouse_wheel_move(dx,dy)Cursor_time = 0 -- ensure cursor is visible immediately after it movesif Focus == 'edit' thenreturn edit.mouse_wheel_move(Editor_state, dx,dy)elsereturn log_browser.mouse_wheel_move(Log_browser_state, dx,dy)endend - edit in run.lua at line 166
function run.mouse_wheel_move(x,y)Cursor_time = 0 -- ensure cursor is visible immediately after it movesreturn edit.mouse_wheel_move(Editor_state, x,y)end - edit in main.lua at line 248
elseassert(false, 'unknown app "'..Current_app..'"')endendfunction App.wheelmoved(dx,dy)if Current_app == 'run' thenif run.mouse_wheel_move then run.mouse_wheel_move(dx,dy) endelseif Current_app == 'source' thenif source.mouse_wheel_move then source.mouse_wheel_move(dx,dy) end - edit in log_browser.lua at line 264
endfunction log_browser.mouse_wheel_move(State, dx,dy)if dy > 0 thenfor i=1,math.floor(dy) dolog_browser.up(State)endelsefor i=1,math.floor(-dy) dolog_browser.down(State)endend - replacement in log_browser.lua at line 284
while State.screen_top1.line > 1 doState.screen_top1.line = State.screen_top1.line-1if should_show(State.lines[State.screen_top1.line]) thenbreakendendlog_browser.up(State) - replacement in log_browser.lua at line 286
while State.screen_top1.line < #State.lines doState.screen_top1.line = State.screen_top1.line+1if should_show(State.lines[State.screen_top1.line]) thenbreakendendlog_browser.down(State) - edit in log_browser.lua at line 302
endendendfunction log_browser.up(State)while State.screen_top1.line > 1 doState.screen_top1.line = State.screen_top1.line-1if should_show(State.lines[State.screen_top1.line]) thenbreak - edit in log_browser.lua at line 315
function log_browser.down(State)while State.screen_top1.line < #State.lines doState.screen_top1.line = State.screen_top1.line+1if should_show(State.lines[State.screen_top1.line]) thenbreakendendend - edit in edit.lua at line 304[9.6276][8.9685]
endendfunction edit.mouse_wheel_move(State, dx,dy)if dy > 0 thenState.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}for i=1,math.floor(dy) doText.up(State)endelseState.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}for i=1,math.floor(-dy) doText.down(State)end