From c817f8412e590b1f499261b2c7c37a5434ce0f07 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Mon, 13 Jun 2016 15:04:49 -0700 Subject: [PATCH] Allow horizontal-only scrolling --- src/Magnum/Platform/Sdl2Application.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 3de708987..6e6ff6235 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -378,12 +378,11 @@ void Sdl2Application::mainLoop() { event.type == SDL_MOUSEBUTTONDOWN ? mousePressEvent(e) : mouseReleaseEvent(e); } break; - case SDL_MOUSEWHEEL: - if(event.wheel.y != 0) { - MouseEvent e(event.wheel.y > 0 ? MouseEvent::Button::WheelUp : MouseEvent::Button::WheelDown, {event.wheel.x, event.wheel.y}, 0); - mousePressEvent(e); - } break; - + case SDL_MOUSEWHEEL: { + MouseEvent e(event.wheel.y > 0 ? MouseEvent::Button::WheelUp : MouseEvent::Button::WheelDown, {event.wheel.x, event.wheel.y}, 0); + mousePressEvent(e); + break; + } case SDL_MOUSEMOTION: { MouseMoveEvent e({event.motion.x, event.motion.y}, {event.motion.xrel, event.motion.yrel}, static_cast(event.motion.state)); mouseMoveEvent(e);