You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (1) { ImU32 col = (!g.NavWindow->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); draw_list->AddCircleFilled(p, 3.0f, col); draw_list->AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); }
9249
+
}
9250
+
#endif
9251
+
}
9252
+
9253
+
static void ImGui::NavUpdateInitResult()
9254
+
{
9255
+
// In very rare cases g.NavWindow may be null (e.g. clearing focus after requesting an init request, which does happen when releasing Alt while clicking on void)
9256
+
ImGuiContext& g = *GImGui;
9257
+
if (!g.NavWindow)
9258
+
return;
9259
+
9260
+
// Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called)
9261
+
// FIXME-NAV: On _NavFlattened windows, g.NavWindow will only be updated during subsequent frame. Not a problem currently.
9262
+
IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", g.NavInitResultId, g.NavLayer, g.NavWindow->Name);
// Forwarding previous request (which has been modified, e.g. wrap around menus rewrite the requests with a starting rectangle at the other side of the window)
9216
-
// (Preserve g.NavMoveRequestFlags, g.NavMoveClipDir which were set by the NavMoveRequestForward() function)
9280
+
// (preserve most state, which were already set by the NavMoveRequestForward() function)
// If we initiate a movement request and have no current NavId, we initiate a InitDefaultRequest that will be used as a fallback if the direction fails to find a match
9245
9310
if (g.NavMoveDir != ImGuiDir_None)
9246
9311
{
9312
+
IM_ASSERT(window != NULL);
9247
9313
g.NavMoveRequest = true;
9248
9314
g.NavMoveRequestKeyMods = io.KeyMods;
9249
9315
g.NavMoveDirLast = g.NavMoveDir;
9316
+
g.NavMoveResultLocal.Clear();
9317
+
g.NavMoveResultLocalVisibleSet.Clear();
9318
+
g.NavMoveResultOther.Clear();
9250
9319
}
9320
+
9321
+
// Moving with no reference triggers a init request
9251
9322
if (g.NavMoveRequest && g.NavId == 0)
9252
9323
{
9253
9324
IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from move, window \"%s\", layer=%d\n", g.NavWindow->Name, g.NavLayer);
// When using gamepad, we project the reference nav bounding box into window visible area.
9292
9331
// This is to allow resuming navigation inside the visible area after doing a large amount of scrolling, since with gamepad every movements are relative
9293
9332
// (can't focus a visible object like we can with the mouse).
9294
9333
if (g.NavMoveRequest && g.NavInputSource == ImGuiInputSource_Gamepad && g.NavLayer == ImGuiNavLayer_Main)
// For scoring we use a single segment on the left side our current item bounding box (not touching the edge to avoid box overlap with zero-spaced items)
IM_ASSERT(!g.NavScoringRect.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allows us to remove extraneous ImFabs() calls in NavScoreItem().
if (1) { ImU32 col = (!g.NavWindow->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); draw_list->AddCircleFilled(p, 3.0f, col); draw_list->AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); }
9323
-
}
9324
-
#endif
9325
-
}
9326
-
9327
-
static void ImGui::NavUpdateInitResult()
9328
-
{
9329
-
// In very rare cases g.NavWindow may be null (e.g. clearing focus after requesting an init request, which does happen when releasing Alt while clicking on void)
9330
-
ImGuiContext& g = *GImGui;
9331
-
if (!g.NavWindow)
9332
-
return;
9333
-
9334
-
// Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called)
9335
-
// FIXME-NAV: On _NavFlattened windows, g.NavWindow will only be updated during subsequent frame. Not a problem currently.
9336
-
IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", g.NavInitResultId, g.NavLayer, g.NavWindow->Name);
IM_ASSERT(!g.NavScoringRect.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allows us to remove extraneous ImFabs() calls in NavScoreItem().
0 commit comments