Internals: SetActiveID window cannot be NULL

This commit is contained in:
omar 2017-10-13 13:07:07 +02:00
parent 4548bcb5c9
commit 48498b337d

View File

@ -1963,9 +1963,9 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
if (id) if (id)
{ {
g.NavId = id; g.NavId = id;
if (window)
// Assume that SetActiveID() is called in the context where its NavLayer is the current layer, which is the case everywhere we call it.
g.NavLayer = window->DC.NavLayerCurrent; g.NavLayer = window->DC.NavLayerCurrent;
if (window) // NB: We current assume that SetActiveId() is called in the context where its NavLayer is the current one, which should be the case.
window->NavLastIds[window->DC.NavLayerCurrent] = id; window->NavLastIds[window->DC.NavLayerCurrent] = id;
if (g.ActiveIdSource == ImGuiInputSource_Nav) if (g.ActiveIdSource == ImGuiInputSource_Nav)
g.NavDisableMouseHover = true; g.NavDisableMouseHover = true;