mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
TabBar: Fixed single tab shrinking reducing the tab to 0.0f size. Broken by a856c670c1
.
This commit is contained in:
parent
f47a0a85cc
commit
80b3ab7d3e
@ -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);
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user