Skip to content

Commit

Permalink
Fix horizontal scroll direction on macOS.
Browse files Browse the repository at this point in the history
See open Dear ImGUI issue:
ocornut/imgui#4019

This patches it for macOS in the local copy of imgui_impl_sdl.
  • Loading branch information
grauw committed May 1, 2022
1 parent 58fe971 commit 4d8f86a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extern/imgui_patched/imgui_impl_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4d8f86a

Please sign in to comment.