Skip to content

Commit

Permalink
Internals, Tabbar: fixed TabBarGetCurrentTab() with tab_idx == 0. (#7629
Browse files Browse the repository at this point in the history
)

Thanks @VerySmallRoach. Amend 3d8885c (#5853, #5997)
  • Loading branch information
ocornut committed May 28, 2024
1 parent 1f9fc38 commit 7f5d5c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit 7f5d5c8

Please sign in to comment.