mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-17 01:04:19 +00:00
TabBar: fixed single-tab not shrinking their width down.
+ minor typo fixes (#2738)
This commit is contained in:
parent
a33cedda14
commit
a856c670c1
4 changed files with 9 additions and 4 deletions
|
|
@ -1361,8 +1361,12 @@ static int IMGUI_CDECL ShrinkWidthItemComparer(const void* lhs, const void* rhs)
|
|||
// Shrink excess width from a set of item, by removing width from the larger items first.
|
||||
void ImGui::ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess)
|
||||
{
|
||||
if (count > 1)
|
||||
ImQsort(items, (size_t)count, sizeof(ImGuiShrinkWidthItem), ShrinkWidthItemComparer);
|
||||
if (count == 1)
|
||||
{
|
||||
items[0].Width -= width_excess;
|
||||
return;
|
||||
}
|
||||
ImQsort(items, (size_t)count, sizeof(ImGuiShrinkWidthItem), ShrinkWidthItemComparer);
|
||||
int count_same_width = 1;
|
||||
while (width_excess > 0.0f && count_same_width < count)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue