From 4d8f86a27c85cb5473a113e9f9c74bbcde22deba Mon Sep 17 00:00:00 2001 From: Laurens Holst Date: Sun, 1 May 2022 17:25:27 +0200 Subject: [PATCH] Fix horizontal scroll direction on macOS. See open Dear ImGUI issue: https://github.com/ocornut/imgui/issues/4019 This patches it for macOS in the local copy of imgui_impl_sdl. --- extern/imgui_patched/imgui_impl_sdl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extern/imgui_patched/imgui_impl_sdl.cpp b/extern/imgui_patched/imgui_impl_sdl.cpp index 2870d2170..c1b2649ca 100644 --- a/extern/imgui_patched/imgui_impl_sdl.cpp +++ b/extern/imgui_patched/imgui_impl_sdl.cpp @@ -300,6 +300,9 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event) { float wheel_x = (event->wheel.x > 0) ? 1.0f : (event->wheel.x < 0) ? -1.0f : 0.0f; float wheel_y = (event->wheel.y > 0) ? 1.0f : (event->wheel.y < 0) ? -1.0f : 0.0f; +#ifdef __APPLE__ + wheel_x = -wheel_x; +#endif io.AddMouseWheelEvent(wheel_x, wheel_y); return true; }