Skip to content

Commit

Permalink
Fix scroll regression introduced in 562ac8f
Browse files Browse the repository at this point in the history
Simply checking that the Buttons bitset of both events is the same is
not enough to set the motion to true. We have to make ture that the
event is only for buttons and not for the mouseweel.
  • Loading branch information
n-peugnet committed Apr 9, 2024
1 parent 7bcc294 commit c8e4bd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ func (app *Application) Start() error {
redraw = app.root.OnPasteEvent(customEvt)
}
case *tcell.EventMouse:
hasMotion := app.prevMouseEvt.Buttons() == event.Buttons()
onlyButtons := event.Buttons() < tcell.WheelUp
hasMotion := onlyButtons && app.prevMouseEvt.Buttons() == event.Buttons()
customEvt := customMouseEvent{event, hasMotion}
app.prevMouseEvt = event
redraw = app.root.OnMouseEvent(customEvt)
Expand Down

0 comments on commit c8e4bd2

Please sign in to comment.