From 089012596203aedca86663fff708a6e915506409 Mon Sep 17 00:00:00 2001 From: DS Date: Sat, 22 Feb 2025 16:17:07 +0100 Subject: [PATCH] SDL Irr device: Ignore +-0.0f y mouse wheel events (#15815) our code often assumes that it's non-zero, e.g.: `event.MouseInput.Wheel < 0 ? -1 : 1` --- irr/src/CIrrDeviceSDL.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/irr/src/CIrrDeviceSDL.cpp b/irr/src/CIrrDeviceSDL.cpp index bcf5415c3..2775858f3 100644 --- a/irr/src/CIrrDeviceSDL.cpp +++ b/irr/src/CIrrDeviceSDL.cpp @@ -706,6 +706,10 @@ bool CIrrDeviceSDL::run() irrevent.MouseInput.X = MouseX; irrevent.MouseInput.Y = MouseY; + // wheel y can be 0 if scrolling sideways + if (irrevent.MouseInput.Wheel == 0.0f) + break; + postEventFromUser(irrevent); break; }