Scrolling: Further reduce unrelease mouse-wheel locked window timer + misc refactor (#2604, #3795, #4559)

The refactor are designed to minimize the diff for changes needed for #3795
This commit is contained in:
ocornut
2022-10-06 14:42:22 +02:00
parent dfa1bb0ac7
commit 8a44c31c95
2 changed files with 23 additions and 20 deletions

View File

@ -1631,7 +1631,7 @@ struct ImGuiContext
ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindow.
ImGuiWindow* WheelingWindow; // Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window.
ImVec2 WheelingWindowRefMousePos;
float WheelingWindowTimer;
float WheelingWindowReleaseTimer;
// Item/widgets state and tracking information
ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
@ -1885,7 +1885,7 @@ struct ImGuiContext
HoveredWindowUnderMovingWindow = NULL;
MovingWindow = NULL;
WheelingWindow = NULL;
WheelingWindowTimer = 0.0f;
WheelingWindowReleaseTimer = 0.0f;
DebugHookIdInfo = 0;
HoveredId = HoveredIdPreviousFrame = 0;