MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / NavMoveRequestTryWrapping

Method NavMoveRequestTryWrapping

include/imgui/imgui.cpp:13528–13537  ·  view source on GitHub ↗

Navigation wrap-around logic is delayed to the end of the frame because this operation is only valid after entire popup is assembled and in case of appended popups it is not clear which EndPopup() call is final.

Source from the content-addressed store, hash-verified

13526// Navigation wrap-around logic is delayed to the end of the frame because this operation is only valid after entire
13527// popup is assembled and in case of appended popups it is not clear which EndPopup() call is final.
13528void ImGui::NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags wrap_flags)
13529{
13530 ImGuiContext& g = *GImGui;
13531 IM_ASSERT((wrap_flags & ImGuiNavMoveFlags_WrapMask_ ) != 0 && (wrap_flags & ~ImGuiNavMoveFlags_WrapMask_) == 0); // Call with _WrapX, _WrapY, _LoopX, _LoopY
13532
13533 // In theory we should test for NavMoveRequestButNoResultYet() but there's no point doing it:
13534 // as NavEndFrame() will do the same test. It will end up calling NavUpdateCreateWrappingRequest().
13535 if (g.NavWindow == window && g.NavMoveScoringItems && g.NavLayer == window->DC.NavLayerCurrent)
13536 g.NavMoveFlags = (g.NavMoveFlags & ~ImGuiNavMoveFlags_WrapMask_) | wrap_flags;
13537}
13538
13539// FIXME: This could be replaced by updating a frame number in each window when (window == NavWindow) and (NavLayer == 0).
13540// This way we could find the last focused window among our children. It would be much less confusing this way?

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected