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

Thanks @VerySmallRoach. Amend 3d8885cbb (#5853, #5997)
features/sdl_renderer3_multiviewports
ocornut ago%!(EXTRA string=11 months)
parent 1f9fc382c3
commit 7f5d5c80b2
  1. 2
      imgui_widgets.cpp

@ -8285,7 +8285,7 @@ ImGuiTabItem* ImGui::TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order)
ImGuiTabItem* ImGui::TabBarGetCurrentTab(ImGuiTabBar* tab_bar) 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 NULL;
return &tab_bar->Tabs[tab_bar->LastTabItemIdx]; return &tab_bar->Tabs[tab_bar->LastTabItemIdx];
} }

Loading…
Cancel
Save