Skip to content

Commit

Permalink
TabBar: Fixed single tab shrinking reducing the tab to 0.0f size. Bro…
Browse files Browse the repository at this point in the history
…ken by a856c67.
  • Loading branch information
ocornut committed Sep 22, 2019
1 parent f47a0a8 commit 80b3ab7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ void ImGui::ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_exc
{
if (count == 1)
{
items[0].Width -= width_excess;
items[0].Width = ImMax(items[0].Width - width_excess, 1.0f);
return;
}
ImQsort(items, (size_t)count, sizeof(ImGuiShrinkWidthItem), ShrinkWidthItemComparer);
Expand Down Expand Up @@ -6562,6 +6562,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
{
ImGuiTabItem* tab = &tab_bar->Tabs[tab_n];
tab->Width = ImMin(tab->WidthContents, tab_max_width);
IM_ASSERT(tab->Width > 0.0f);
}
}

Expand Down

0 comments on commit 80b3ab7

Please sign in to comment.