some minor cleanup

I can't see the mouse wheel ever setting dx, but it's more obvious now
that the editor doesn't support panning left/right.
This commit is contained in:
Kartik K. Agaram 2023-03-23 21:38:33 -07:00
parent 99faf61abb
commit a6dcfc5ac8
4 changed files with 5 additions and 5 deletions

View File

@ -310,7 +310,7 @@ function edit.mouse_wheel_move(State, dx,dy)
for i=1,math.floor(dy) do
Text.up(State)
end
else
elseif dy < 0 then
State.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}
for i=1,math.floor(-dy) do
Text.down(State)

View File

@ -268,7 +268,7 @@ function log_browser.mouse_wheel_move(State, dx,dy)
for i=1,math.floor(dy) do
log_browser.up(State)
end
else
elseif dy < 0 then
for i=1,math.floor(-dy) do
log_browser.down(State)
end

View File

@ -163,9 +163,9 @@ function run.mouse_release(x,y, mouse_button)
return edit.mouse_release(Editor_state, x,y, mouse_button)
end
function run.mouse_wheel_move(x,y)
function run.mouse_wheel_move(dx,dy)
Cursor_time = 0 -- ensure cursor is visible immediately after it moves
return edit.mouse_wheel_move(Editor_state, x,y)
return edit.mouse_wheel_move(Editor_state, dx,dy)
end
function run.text_input(t)

View File

@ -311,7 +311,7 @@ function edit.mouse_wheel_move(State, dx,dy)
for i=1,math.floor(dy) do
Text.up(State)
end
else
elseif dy < 0 then
State.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}
for i=1,math.floor(-dy) do
Text.down(State)