SDL: Added mouse wheel deltas with floating point precision

From 5dbbc8e61fde3572be186e82b8d9d491eccdff22 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 8 Nov 2021 09:44:31 -0800
Subject: [PATCH] Added mouse wheel deltas with floating point precision

Fixes https://github.com/libsdl-org/SDL/issues/4888
---
 include/SDL_events.h   | 2 ++
 src/events/SDL_mouse.c | 6 ++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/SDL_events.h b/include/SDL_events.h
index 9718c404ae..3c3b79d433 100644
--- a/include/SDL_events.h
+++ b/include/SDL_events.h
@@ -301,6 +301,8 @@ typedef struct SDL_MouseWheelEvent
     Sint32 x;           /**< The amount scrolled horizontally, positive to the right and negative to the left */
     Sint32 y;           /**< The amount scrolled vertically, positive away from the user and negative toward the user */
     Uint32 direction;   /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
+    float preciseX;     /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */
+    float preciseY;     /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */
 } SDL_MouseWheelEvent;
 
 /**
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index 1e8e50f940..155110ce27 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -650,12 +650,10 @@ SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, float x, float y, S
         event.type = SDL_MOUSEWHEEL;
         event.wheel.windowID = mouse->focus ? mouse->focus->id : 0;
         event.wheel.which = mouseID;
-#if 0 /* Uncomment this when it goes in for SDL 2.1 */
-        event.wheel.preciseX = x;
-        event.wheel.preciseY = y;
-#endif
         event.wheel.x = integral_x;
         event.wheel.y = integral_y;
+        event.wheel.preciseX = x;
+        event.wheel.preciseY = y;
         event.wheel.direction = (Uint32)direction;
         posted = (SDL_PushEvent(&event) > 0);
     }