mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	Backends, Inputs: Made horizontal scroll wheel and horizontal scroll direction consistent accross backends/os. (#4019, #6096, #1463)
Documented assumptions.
This commit is contained in:
		@@ -1467,7 +1467,7 @@ void ImGuiIO::AddMouseButtonEvent(int mouse_button, bool down)
 | 
			
		||||
    g.InputEventsQueue.push_back(e);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Queue a mouse wheel event (most mouse/API will only have a Y component)
 | 
			
		||||
// Queue a mouse wheel event (some mouse/API may only have a Y component)
 | 
			
		||||
void ImGuiIO::AddMouseWheelEvent(float wheel_x, float wheel_y)
 | 
			
		||||
{
 | 
			
		||||
    ImGuiContext& g = *GImGui;
 | 
			
		||||
@@ -8488,7 +8488,8 @@ void ImGui::UpdateMouseWheel()
 | 
			
		||||
 | 
			
		||||
    // Mouse wheel scrolling
 | 
			
		||||
    // As a standard behavior holding SHIFT while using Vertical Mouse Wheel triggers Horizontal scroll instead
 | 
			
		||||
    // (we avoid doing it on OSX as it the OS input layer handles this already)
 | 
			
		||||
    // - We avoid doing it on OSX as it the OS input layer handles this already.
 | 
			
		||||
    // - However this means when running on OSX over Emcripten, Shift+WheelY will incur two swappings (1 in OS, 1 here), cancelling the feature.
 | 
			
		||||
    const bool swap_axis = g.IO.KeyShift && !g.IO.ConfigMacOSXBehaviors;
 | 
			
		||||
    if (swap_axis)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user