mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-06 06:25:54 +01:00
Scrolling: when scrolling a window with the mouse wheel, own the wheel when its lock starts
This commit is contained in:
parent
6d32174508
commit
a27933f6b5
@ -10698,6 +10698,7 @@ void ImGui::UpdateMouseWheel()
|
||||
if (do_scroll[ImGuiAxis_X])
|
||||
{
|
||||
LockWheelingWindow(window, wheel.x);
|
||||
SetKeyOwner(ImGuiKey_MouseWheelX, window->ID);
|
||||
float max_step = window->InnerRect.GetWidth() * 0.67f;
|
||||
float scroll_step = ImTrunc(ImMin(2 * window->FontRefSize, max_step));
|
||||
SetScrollX(window, window->Scroll.x - wheel.x * scroll_step);
|
||||
@ -10706,6 +10707,7 @@ void ImGui::UpdateMouseWheel()
|
||||
if (do_scroll[ImGuiAxis_Y])
|
||||
{
|
||||
LockWheelingWindow(window, wheel.y);
|
||||
SetKeyOwner(ImGuiKey_MouseWheelY, window->ID);
|
||||
float max_step = window->InnerRect.GetHeight() * 0.67f;
|
||||
float scroll_step = ImTrunc(ImMin(5 * window->FontRefSize, max_step));
|
||||
SetScrollY(window, window->Scroll.y - wheel.y * scroll_step);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user