Nav: Store per-window last nav id also per-layer so we can easily query them for menu navigation code. (#787)

This commit is contained in:
omar
2017-09-29 17:58:25 +02:00
parent 8a814487fe
commit 9737efb2f1
2 changed files with 20 additions and 18 deletions

View File

@ -764,7 +764,6 @@ struct IMGUI_API ImGuiWindow
bool Appearing; // Set during the frame where the window is appearing (or re-appearing)
int BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
ImGuiID NavLastId; // Last known NavId for this window, for nav layer 0 only.
int AutoFitFramesX, AutoFitFramesY;
bool AutoFitOnlyGrows;
int AutoFitChildAxises;
@ -776,6 +775,8 @@ struct IMGUI_API ImGuiWindow
ImVec2 SetWindowPosVal; // store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
ImVec2 SetWindowPosPivot; // store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right.
ImGuiID NavLastIds[2]; // Last known NavId for this window, per layer (0/1)
ImGuiDrawContext DC; // Temporary per-window data, reset at the beginning of the frame
ImVector<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack
ImRect ClipRect; // = DrawList->clip_rect_stack.back(). Scissoring / clipping rectangle. x1, y1, x2, y2.