mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-20 07:02:28 +00:00
Fix momentum scroll scale not being set for negative deltas
The scale between scaled and unscaled offsets was only calculated for positive deltas, so when scrolling up or left it stayed at zero (or stale from a previous scroll), causing momentum events to have zero offsets. Closes #10610
This commit is contained in:
parent
007e61a59e
commit
51aa327be1
2 changed files with 6 additions and 2 deletions
|
|
@ -269,6 +269,10 @@ Detailed list of changes
|
|||
- Wayland: Fix the window class (app_id) and title being lost when an OS window
|
||||
is hidden and then shown again (:iss:`10602`)
|
||||
|
||||
- Linux: Fix momentum scrolling not coasting when scrolling up or left, until
|
||||
the first scroll down or right (:pull:`10610`)
|
||||
|
||||
|
||||
0.49.2 [2026-10-01]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
4
glfw/momentum-scroll.c
vendored
4
glfw/momentum-scroll.c
vendored
|
|
@ -221,8 +221,8 @@ handle_scroll_event(_GLFWwindow *w, const GLFWScrollEvent *ev, bool stopped, boo
|
|||
memset(&s.physical_event, 0, sizeof(s.physical_event));
|
||||
s.physical_event.start = now;
|
||||
}
|
||||
if (ev->unscaled.y > 0) s.scale = ev->y_offset / ev->unscaled.y;
|
||||
else if (ev->unscaled.x > 0) s.scale = ev->x_offset / ev->unscaled.x;
|
||||
if (ev->unscaled.y != 0) s.scale = ev->y_offset / ev->unscaled.y;
|
||||
else if (ev->unscaled.x != 0) s.scale = ev->x_offset / ev->unscaled.x;
|
||||
if (s.window_id && s.window_id != w->id) cancel_existing_scroll(true);
|
||||
if (s.state != PHYSICAL_EVENT_IN_PROGRESS) cancel_existing_scroll(false);
|
||||
if (!is_synthetic_momentum_start_event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue