MovingWindow: Track click offset based on MovingWindow and not its RootWindow. Followup to 3849bb4470. Comments + adding a local to ease patch #1345.

This commit is contained in:
omar
2018-01-14 14:13:54 +01:00
parent 8b432cf590
commit 514d30d8cd
2 changed files with 12 additions and 5 deletions

View File

@ -534,7 +534,7 @@ struct ImGuiContext
bool ActiveIdAllowOverlap; // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
ImGuiWindow* ActiveIdWindow;
ImGuiWindow* MovingWindow; // Track the child window we clicked on to move a window.
ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.
ImGuiID MovingWindowMoveId; // == MovingWindow->MoveId
ImVector<ImGuiColMod> ColorModifiers; // Stack for PushStyleColor()/PopStyleColor()
ImVector<ImGuiStyleMod> StyleModifiers; // Stack for PushStyleVar()/PopStyleVar()