Skip to content

Commit

Permalink
Nav: fixing assert using Tab in a window without any tabbable element (
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut authored and actondev committed Nov 26, 2021
1 parent 211b47e commit 7cdc7fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9685,11 +9685,8 @@ void ImGui::NavMoveRequestApplyResult()

// Tabbing forward wrap
if (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing)
if (g.NavTabbingCounter == 1 || g.NavTabbingDir == 0)
{
IM_ASSERT(g.NavTabbingResultFirst.ID != 0);
if ((g.NavTabbingCounter == 1 || g.NavTabbingDir == 0) && g.NavTabbingResultFirst.ID)
result = &g.NavTabbingResultFirst;
}

// In a situation when there is no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result)
if (result == NULL)
Expand Down
4 changes: 2 additions & 2 deletions imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Index of this file:
// Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
#define IMGUI_VERSION "1.86 WIP"
#define IMGUI_VERSION_NUM 18509
#define IMGUI_VERSION_NUM 18510
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
#define IMGUI_HAS_TABLE

Expand Down Expand Up @@ -2209,7 +2209,7 @@ struct ImGuiListClipper

// Call ForceDisplayRangeByIndices() before first call to Step() if you need a range of items to be displayed regardless of visibility.
IMGUI_API void ForceDisplayRangeByIndices(int item_min, int item_max); // item_max is exclusive e.g. use (42, 42+1) to make item 42 always visible BUT due to alignment/padding of certain items it is likely that an extra item may be included on either end of the display range.

#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
inline ImGuiListClipper(int items_count, float items_height = -1.0f) { memset(this, 0, sizeof(*this)); ItemsCount = -1; Begin(items_count, items_height); } // [removed in 1.79]
#endif
Expand Down

0 comments on commit 7cdc7fb

Please sign in to comment.