Nav: Fixed an assert in certain circumstance (mostly when using popups) when mouse positions stop being valid. (#2168) + adding a else block to make NavCalcPreferredRefPos() more explicit.
returnImFloor(ImClamp(pos,visible_rect.Min,visible_rect.Max));// ImFloor() is important because non-integer mouse position application in back-end might be lossy and result in undesirable non-zero delta.
{
// Mouse (we need a fallback in case the mouse becomes invalid after being used)
if(IsMousePosValid(&g.IO.MousePos))
returng.IO.MousePos;
returng.LastValidMousePos;
}
else
{
// When navigation is active and mouse is disabled, decide on an arbitrary position around the bottom left of the currently navigated item.
returnImFloor(ImClamp(pos,visible_rect.Min,visible_rect.Max));// ImFloor() is important because non-integer mouse position application in back-end might be lossy and result in undesirable non-zero delta.
ImGuiInputSourceActiveIdSource;// Activating with mouse or nav (gamepad/keyboard)
ImGuiIDLastActiveId;// Store the last non-zero ActiveId, useful for animation.
floatLastActiveIdTimer;// Store the last non-zero ActiveId timer since the beginning of activation, useful for animation.
ImVec2LastValidMousePos;
ImGuiWindow*MovingWindow;// Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.
ImVector<ImGuiColorMod>ColorModifiers;// Stack for PushStyleColor()/PopStyleColor()
ImVector<ImGuiColorMod>ColorModifiers;// Stack for PushStyleColor()/PopStyleColor()
ImVector<ImGuiStyleMod>StyleModifiers;// Stack for PushStyleVar()/PopStyleVar()
ImVector<ImFont*>FontStack;// Stack for PushFont()/PopFont()
ImVector<ImGuiPopupRef>OpenPopupStack;// Which popups are open (persistent)