Internals, Tabbar: fixed TabBarGetCurrentTab() with tab_idx == 0. (#7629)
Thanks @VerySmallRoach. Amend 3d8885cbb (#5853, #5997)
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index 0c45616..2e40fa6 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -8285,7 +8285,7 @@
ImGuiTabItem* ImGui::TabBarGetCurrentTab(ImGuiTabBar* tab_bar)
{
- if (tab_bar->LastTabItemIdx <= 0 || tab_bar->LastTabItemIdx >= tab_bar->Tabs.Size)
+ if (tab_bar->LastTabItemIdx < 0 || tab_bar->LastTabItemIdx >= tab_bar->Tabs.Size)
return NULL;
return &tab_bar->Tabs[tab_bar->LastTabItemIdx];
}