|
@@ -1575,8 +1575,8 @@ void ImGui::ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_exc
|
|
width_excess += items[n].Width - width_rounded;
|
|
width_excess += items[n].Width - width_rounded;
|
|
items[n].Width = width_rounded;
|
|
items[n].Width = width_rounded;
|
|
}
|
|
}
|
|
- while (width_excess > 0.0f)
|
|
|
|
- for (int n = 0; n < count; n++)
|
|
|
|
|
|
+ while (width_excess >= 1.0f)
|
|
|
|
+ for (int n = 0; n < count && width_excess >= 1.0f; n++)
|
|
if (items[n].Width + 1.0f <= items[n].InitialWidth)
|
|
if (items[n].Width + 1.0f <= items[n].InitialWidth)
|
|
{
|
|
{
|
|
items[n].Width += 1.0f;
|
|
items[n].Width += 1.0f;
|
|
@@ -7596,7 +7596,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
|
|
width_excess = (section_0_w + section_2_w) - tab_bar->BarRect.GetWidth(); // Excess used to shrink leading/trailing section
|
|
width_excess = (section_0_w + section_2_w) - tab_bar->BarRect.GetWidth(); // Excess used to shrink leading/trailing section
|
|
|
|
|
|
// With ImGuiTabBarFlags_FittingPolicyScroll policy, we will only shrink leading/trailing if the central section is not visible anymore
|
|
// With ImGuiTabBarFlags_FittingPolicyScroll policy, we will only shrink leading/trailing if the central section is not visible anymore
|
|
- if (width_excess > 0.0f && ((tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyResizeDown) || !central_section_is_visible))
|
|
|
|
|
|
+ if (width_excess >= 1.0f && ((tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyResizeDown) || !central_section_is_visible))
|
|
{
|
|
{
|
|
int shrink_data_count = (central_section_is_visible ? sections[1].TabCount : sections[0].TabCount + sections[2].TabCount);
|
|
int shrink_data_count = (central_section_is_visible ? sections[1].TabCount : sections[0].TabCount + sections[2].TabCount);
|
|
int shrink_data_offset = (central_section_is_visible ? sections[0].TabCount + sections[2].TabCount : 0);
|
|
int shrink_data_offset = (central_section_is_visible ? sections[0].TabCount + sections[2].TabCount : 0);
|