Explorar o código

Fixed horizontal mouse wheel not forwarding the request to the parent window if ImGuiWindowFlags_NoScrollWithMouse is set. (#1463, #1380, #1502)

omar %!s(int64=7) %!d(string=hai) anos
pai
achega
528b50a89f
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 1 0
      CHANGELOG.txt
  2. 2 3
      imgui.cpp

+ 1 - 0
CHANGELOG.txt

@@ -55,6 +55,7 @@ Other Changes:
  - IsItemHovered(): Added ImGuiHoveredFlags_AllowWhenDisabled flag to query hovered status on disabled items. (#1940, #211)
  - Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut] 
  - Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
+ - Fixed horizontal mouse wheel not forwarding the request to the parent window if ImGuiWindowFlags_NoScrollWithMouse is set. (#1463, #1380, #1502)
  - Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
  - OS/Windows: Fixed missing ImmReleaseContext() call in the default Win32 IME handler. (#1932) [@vby]
  - Demo: Added basic Drag and Drop demo. (#143)

+ 2 - 3
imgui.cpp

@@ -3734,12 +3734,11 @@ void ImGui::UpdateMouseWheel()
             SetWindowScrollY(scroll_window, scroll_window->Scroll.y - g.IO.MouseWheel * scroll_amount);
         }
     }
-    if (g.IO.MouseWheelH != 0.0f && scroll_allowed)
+    if (g.IO.MouseWheelH != 0.0f && scroll_allowed && !g.IO.KeyCtrl)
     {
         // Mouse wheel horizontal scrolling (for hardware that supports it)
         float scroll_amount = scroll_window->CalcFontSize();
-        if (!g.IO.KeyCtrl && !(window->Flags & ImGuiWindowFlags_NoScrollWithMouse))
-            SetWindowScrollX(window, window->Scroll.x - g.IO.MouseWheelH * scroll_amount);
+        SetWindowScrollX(scroll_window, scroll_window->Scroll.x - g.IO.MouseWheelH * scroll_amount);
     }
 }