mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-24 13:49:01 +08:00
Mouse wheel scrolling doesn't change speed inside Combo box (uses to slow down from 5 to 3) but instead slow down on window that are smaller than the scroll speed.
This commit is contained in:
parent
a263dce2f2
commit
457011660e
@ -2449,9 +2449,10 @@ void ImGui::NewFrame()
|
||||
}
|
||||
else if (!g.IO.KeyCtrl && !(window->Flags & ImGuiWindowFlags_NoScrollWithMouse))
|
||||
{
|
||||
// Scroll
|
||||
const int scroll_lines = (window->Flags & ImGuiWindowFlags_ComboBox) ? 3 : 5;
|
||||
SetWindowScrollY(window, window->Scroll.y - g.IO.MouseWheel * window->CalcFontSize() * scroll_lines);
|
||||
// Mouse wheel Scrolling
|
||||
float scroll_amount = 5 * window->CalcFontSize();
|
||||
scroll_amount = (float)(int)ImMin(scroll_amount, (window->ContentsRegionRect.GetHeight() + window->WindowPadding.y * 2.0f) * 0.67f);
|
||||
SetWindowScrollY(window, window->Scroll.y - g.IO.MouseWheel * scroll_amount);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user