From 412daf7362b40869e38c0ee57f07127eed04bdde Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 7 Aug 2025 16:41:21 +0200 Subject: [PATCH] Tabs: attempt to fix infinite loop in tab-bar ShrinkWidth() by using an epsilon. (#5652, #3421, #8800) --- imgui_widgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index cb5dade87..946ac74e2 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -1840,7 +1840,7 @@ void ImGui::ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_exc } ImQsort(items, (size_t)count, sizeof(ImGuiShrinkWidthItem), ShrinkWidthItemComparer); // Sort largest first, smallest last. int count_same_width = 1; - while (width_excess > 0.0f && count_same_width < count) + while (width_excess > 0.001f && count_same_width < count) { while (count_same_width < count && items[0].Width <= items[count_same_width].Width) count_same_width++;