mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-23 04:17:00 +00: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))
|
else if (!g.IO.KeyCtrl && !(window->Flags & ImGuiWindowFlags_NoScrollWithMouse))
|
||||||
{
|
{
|
||||||
// Scroll
|
// Mouse wheel Scrolling
|
||||||
const int scroll_lines = (window->Flags & ImGuiWindowFlags_ComboBox) ? 3 : 5;
|
float scroll_amount = 5 * window->CalcFontSize();
|
||||||
SetWindowScrollY(window, window->Scroll.y - g.IO.MouseWheel * window->CalcFontSize() * scroll_lines);
|
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