Tables: Fixed very small tables edge cases: inverted clip rect with freezing + scroll, missing borders.

This commit is contained in:
ocornut 2021-01-14 17:41:00 +01:00
parent b0db741770
commit 9e281c12a8

View file

@ -1010,7 +1010,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
} }
if (visible_n < table->FreezeColumnsCount) if (visible_n < table->FreezeColumnsCount)
host_clip_rect.Min.x = ImMax(host_clip_rect.Min.x, column->MaxX + TABLE_BORDER_SIZE); host_clip_rect.Min.x = ImClamp(column->MaxX + TABLE_BORDER_SIZE, host_clip_rect.Min.x, host_clip_rect.Max.x);
offset_x += column->WidthGiven + table->CellSpacingX1 + table->CellSpacingX2 + table->CellPaddingX * 2.0f; offset_x += column->WidthGiven + table->CellSpacingX1 + table->CellSpacingX2 + table->CellPaddingX * 2.0f;
visible_n++; visible_n++;
@ -2344,7 +2344,7 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
void ImGui::TableDrawBorders(ImGuiTable* table) void ImGui::TableDrawBorders(ImGuiTable* table)
{ {
ImGuiWindow* inner_window = table->InnerWindow; ImGuiWindow* inner_window = table->InnerWindow;
if (inner_window->Hidden || !table->HostClipRect.Overlaps(table->InnerClipRect)) if (!table->OuterWindow->ClipRect.Overlaps(table->OuterRect))
return; return;
ImDrawList* inner_drawlist = inner_window->DrawList; ImDrawList* inner_drawlist = inner_window->DrawList;