Move check for zero scroll distance to scroll_event()

This commit is contained in:
Luflosi 2018-12-27 15:17:18 +01:00
parent 7652065134
commit e47e2b2560
No known key found for this signature in database
GPG Key ID: 14140F703B7D8362
2 changed files with 2 additions and 2 deletions

View File

@ -940,7 +940,6 @@ is_ascii_control_char(char x) {
break; break;
} }
if (fabs(deltaX) > 0.0 || fabs(deltaY) > 0.0)
_glfwInputScroll(window, deltaX, deltaY, flags); _glfwInputScroll(window, deltaX, deltaY, flags);
} }

View File

@ -586,6 +586,7 @@ scroll_event(double UNUSED xoffset, double yoffset, int flags) {
default: default:
break; break;
} }
if (yoffset == 0.0) return;
if (is_high_resolution) { if (is_high_resolution) {
yoffset *= OPT(touch_scroll_multiplier); yoffset *= OPT(touch_scroll_multiplier);
if (yoffset * global_state.callback_os_window->pending_scroll_pixels < 0) { if (yoffset * global_state.callback_os_window->pending_scroll_pixels < 0) {