Nav: Internals: Exposed NavMoveRequestCancel in imgui_internal.h (#1640)

This commit is contained in:
omar 2018-02-22 15:39:49 +01:00
parent f43068c543
commit b28995b667
2 changed files with 3 additions and 2 deletions

View File

@ -2349,7 +2349,7 @@ static bool NavMoveRequestButNoResultYet()
return g.NavMoveRequest && g.NavMoveResultLocal.ID == 0 && g.NavMoveResultOther.ID == 0;
}
static void NavMoveRequestCancel()
void ImGui::NavMoveRequestCancel()
{
ImGuiContext& g = *GImGui;
g.NavMoveRequest = false;
@ -5006,7 +5006,7 @@ static void NavProcessMoveRequestWrapAround(ImGuiWindow* window)
if ((g.NavMoveDir == ImGuiDir_Up || g.NavMoveDir == ImGuiDir_Down) && g.NavMoveRequestForward == ImGuiNavForward_None && g.NavLayer == 0)
{
g.NavMoveRequestForward = ImGuiNavForward_ForwardQueued;
NavMoveRequestCancel();
ImGui::NavMoveRequestCancel();
g.NavWindow->NavRectRel[0].Min.y = g.NavWindow->NavRectRel[0].Max.y = ((g.NavMoveDir == ImGuiDir_Up) ? ImMax(window->SizeFull.y, window->SizeContents.y) : 0.0f) - window->Scroll.y;
}
}

View File

@ -1066,6 +1066,7 @@ namespace ImGui
IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip = true);
IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit);
IMGUI_API void NavMoveRequestCancel();
IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.
IMGUI_API float GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode);