AModule::getScrollDir: get deltas in a more C++ way

This commit is contained in:
Patrick Hilhorst 2019-06-17 20:29:37 +02:00
parent 2c038d1977
commit 7c85aec8e0
No known key found for this signature in database
GPG Key ID: 589BB0A8DAFEF2B2

View File

@ -63,10 +63,9 @@ AModule::SCROLL_DIR AModule::getScrollDir(GdkEventScroll* e) {
return SCROLL_DIR::RIGHT;
} else if (e->direction == GDK_SCROLL_SMOOTH) {
SCROLL_DIR dir{SCROLL_DIR::NONE};
gdouble delta_x, delta_y;
gdk_event_get_scroll_deltas(reinterpret_cast<const GdkEvent*>(e), &delta_x, &delta_y);
distance_scrolled_y_ += delta_y;
distance_scrolled_x_ += delta_x;
distance_scrolled_y_ += e->delta_y;
distance_scrolled_x_ += e->delta_x;
gdouble threshold = 0;
if (config_["smooth-scrolling-threshold"].isNumeric()) {