sdgui: fix up the smooth scrolling commit

This commit is contained in:
Přemysl Eric Janouch 2022-07-24 22:47:38 +02:00
parent 6f5e32386e
commit aa985514a6
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -489,8 +489,9 @@ stardict_view_scroll_event (GtkWidget *widget, GdkEventScroll *event)
{
// On GDK/Wayland, the mouse wheel will typically create 1.5 deltas,
// after dividing a 15 degree click angle from libinput by 10.
// (Noticed on Arch + Sway, cannot reproduce on Ubuntu 22.04.)
// On X11, as libinput(4) indicates, the delta will always be 1.0.
double delta = CLAMP(event->delta_y, -1, +1);
double delta = CLAMP (event->delta_y, -1, +1);
stardict_view_scroll (self, GTK_SCROLL_STEPS, 3 * delta);
return TRUE;
}