|
@@ -18,6 +18,7 @@
|
|
|
|
|
|
// CHANGELOG
|
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
+// 2023-02-02: Removed SDL_MOUSEWHEEL value clamping, as values seem correct in latest Emscripten. (#4019)
|
|
|
// 2023-02-01: Flipping SDL_MOUSEWHEEL 'wheel.x' value to match other backends and offer consistent horizontal scrolling direction. (#4019, #6096, #1463)
|
|
|
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
|
|
|
// 2022-09-26: Inputs: Disable SDL 2.0.22 new "auto capture" (SDL_HINT_MOUSE_AUTO_CAPTURE) which prevents drag and drop across windows for multi-viewport support + don't capture when drag and dropping. (#5710)
|
|
@@ -261,8 +262,8 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
|
|
|
}
|
|
|
case SDL_MOUSEWHEEL:
|
|
|
{
|
|
|
- float wheel_x = (event->wheel.x < 0) ? 1.0f : (event->wheel.x > 0) ? -1.0f : 0.0f; // About the clamping and flipped axis: see #4019
|
|
|
- float wheel_y = (event->wheel.y > 0) ? 1.0f : (event->wheel.y < 0) ? -1.0f : 0.0f;
|
|
|
+ float wheel_x = -(float)event->wheel.x;
|
|
|
+ float wheel_y = (float)event->wheel.y;
|
|
|
io.AddMouseWheelEvent(wheel_x, wheel_y);
|
|
|
return true;
|
|
|
}
|