Skip to content

Commit cad8935

Browse files
committed
Tables: revert setting colum cliprect.max.x to WorkMax.x instead of Max.x at it complicates header code. Fix clipped sort arrow. (amend 17536f9)
1 parent bff1836 commit cad8935

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

imgui_tables.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
925925
// Lock all our positions
926926
// - ClipRect.Min.x: Because merging draw commands doesn't compare min boundaries, we make ClipRect.Min.x match left bounds to be consistent regardless of merging.
927927
// - ClipRect.Max.x: using WorkMaxX instead of MaxX (aka including padding) makes things more consistent when resizing down, tho slightly detrimental to visibility in very-small column.
928+
// - ClipRect.Max.x: using MaxX makes it easier for header to receive hover highlight with no discontinuity and display sorting arrow.
928929
// - FIXME-TABLE: We want equal width columns to have equal (ClipRect.Max.x - WorkMinX) width, which means ClipRect.max.x cannot stray off host_clip_rect.Max.x else right-most column may appear shorter.
929930
column->MinX = offset_x;
930931
column->MaxX = offset_x + column->WidthGiven + table->CellSpacingX1 + table->CellSpacingX2 + table->CellPaddingX * 2.0f;
@@ -933,7 +934,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
933934
column->ItemWidth = ImFloor(column->WidthGiven * 0.65f);
934935
column->ClipRect.Min.x = column->MinX;
935936
column->ClipRect.Min.y = work_rect.Min.y;
936-
column->ClipRect.Max.x = column->WorkMaxX; //column->MaxX;
937+
column->ClipRect.Max.x = column->MaxX; //column->WorkMaxX;
937938
column->ClipRect.Max.y = FLT_MAX;
938939
column->ClipRect.ClipWithFull(host_clip_rect);
939940

0 commit comments

Comments
 (0)