AModule::getScrollDir: convert reset if-else into switch
This commit is contained in:
parent
86d6668ed4
commit
12b30ca25f
|
@ -79,11 +79,19 @@ AModule::SCROLL_DIR AModule::getScrollDir(GdkEventScroll* e) {
|
||||||
dir = SCROLL_DIR::LEFT;
|
dir = SCROLL_DIR::LEFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir == SCROLL_DIR::UP || dir == SCROLL_DIR::DOWN) {
|
switch (dir) {
|
||||||
distance_scrolled_y_ = 0;
|
case SCROLL_DIR::UP:
|
||||||
} else if (dir == SCROLL_DIR::LEFT || dir == SCROLL_DIR::RIGHT) {
|
case SCROLL_DIR::DOWN:
|
||||||
distance_scrolled_x_ = 0;
|
distance_scrolled_y_ = 0;
|
||||||
|
break;
|
||||||
|
case SCROLL_DIR::LEFT:
|
||||||
|
case SCROLL_DIR::RIGHT:
|
||||||
|
distance_scrolled_x_ = 0;
|
||||||
|
break;
|
||||||
|
case SCROLL_DIR::NONE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
// Silence -Wreturn-type:
|
// Silence -Wreturn-type:
|
||||||
|
|
Loading…
Reference in New Issue