mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-16 01:35:07 +00:00
Merge pull request #409 from grauw/macos-horizontal-scroll
Fix horizontal scroll direction on macOS.
This commit is contained in:
commit
9e909a4aac
1 changed files with 3 additions and 0 deletions
3
extern/imgui_patched/imgui_impl_sdl.cpp
vendored
3
extern/imgui_patched/imgui_impl_sdl.cpp
vendored
|
@ -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_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;
|
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);
|
io.AddMouseWheelEvent(wheel_x, wheel_y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue