Internals, Tabbar: fixed TabBarGetCurrentTab() with tab_idx == 0. (#7629)

Thanks @VerySmallRoach. Amend 3d8885cbb (#5853, #5997)
This commit is contained in:
ocornut 2024-05-28 10:10:39 +02:00
parent 1f9fc382c3
commit 7f5d5c80b2

View File

@ -8285,7 +8285,7 @@ ImGuiTabItem* ImGui::TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order)
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];
}