AModule::getScrollDir: get deltas in a more C++ way
parent
2c038d1977
commit
7c85aec8e0
|
@ -63,10 +63,9 @@ AModule::SCROLL_DIR AModule::getScrollDir(GdkEventScroll* e) {
|
||||||
return SCROLL_DIR::RIGHT;
|
return SCROLL_DIR::RIGHT;
|
||||||
} else if (e->direction == GDK_SCROLL_SMOOTH) {
|
} else if (e->direction == GDK_SCROLL_SMOOTH) {
|
||||||
SCROLL_DIR dir{SCROLL_DIR::NONE};
|
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_ += e->delta_y;
|
||||||
distance_scrolled_y_ += delta_y;
|
distance_scrolled_x_ += e->delta_x;
|
||||||
distance_scrolled_x_ += delta_x;
|
|
||||||
|
|
||||||
gdouble threshold = 0;
|
gdouble threshold = 0;
|
||||||
if (config_["smooth-scrolling-threshold"].isNumeric()) {
|
if (config_["smooth-scrolling-threshold"].isNumeric()) {
|
||||||
|
|
Loading…
Reference in New Issue