From 7f5d5c80b2f42532209fd0f7f3cf804b75df57e7 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 28 May 2024 10:10:39 +0200 Subject: [PATCH] Internals, Tabbar: fixed TabBarGetCurrentTab() with tab_idx == 0. (#7629) Thanks @VerySmallRoach. Amend 3d8885cbb (#5853, #5997) --- imgui_widgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 0c4561630..2e40fa68a 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -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]; }