diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 042af866..ca84674a 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -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); } }