Skip to content

Commit

Permalink
Backends: GLFW: Removed mouse-wheel value scaling for Emscripten. (#4019
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Feb 2, 2023
1 parent f822e07 commit 0370856
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions backends/imgui_impl_glfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yo
#if defined(__EMSCRIPTEN__)
// Emscripten's GLFW emulation reports grossly mis-scaled and flipped scroll events.
// The scale is still currently incorrect, see #4019 #6096 for details.
xoffset /= -120.0f;
yoffset /= -120.0f;
xoffset = -xoffset;
yoffset = -yoffset;
#endif

ImGuiIO& io = ImGui::GetIO();
Expand Down
6 changes: 3 additions & 3 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Breaking changes:
offer consistent horizontal scrolling direction. (#4019)
- Backends: SDL: flipping SDL_MOUSEWHEEL 'wheel.x' value to match other backends and
offer consistent horizontal scrolling direction. (#4019)
- Backends: GLFW+Emscripten: flipping both wheels axises + scaling magnitude down when
running on Emscripten's GLFW emulation. (#6096) [@topolarity]
- Backends: GLFW+Emscripten: flipping both wheels axises when running on Emscripten's
GLFW emulation. (#6096) [@topolarity]
- Shift+WheelY support on non-OSX machines was already correct. (#2424, #1463)
(whereaas on OSX machines Shift+WheelY turns into WheelX at the OS level).
- If you use a custom-backend, you should verify that:
Expand All @@ -58,7 +58,7 @@ Breaking changes:
- (*) both axises flipped On Windows for touchpad only when 'Settings->Touchpad->Down motion scrolls up' is set.
- You can use 'Demo->Tools->Debug Log->IO" to visualize values submitted to Dear ImGui.
- Known issues remaining with Emscripten:
- The magnitude of wheeling values on Emscripten setups is still mostly wrong. (#6096)
- The magnitude of wheeling values on Emscripten setups is still not great. (#6096)
- When running the Emscripten app on a Mac with a mouse, SHIFT+WheelY doesn't turn into WheelX.
This is because we don't know that we are running on Mac and apply our own Shift+swapping
on top of OSX' own swapping, so wheel axises are swapped twice. Emscripten apps may need
Expand Down

0 comments on commit 0370856

Please sign in to comment.