// - We allocate them following the storage order instead of the display order so reordering won't needlessly increase overall dormant memory cost
// - We allocate them following the storage order instead of the display order so reordering columns won't needlessly increase overall dormant memory cost.
// - We isolate headers draw commands in their own channels instead of just altering clip rects. This is in order to facilitate merging of draw commands.
// - After crossing FreezeRowsCount, all columns see their current draw channel increased.
// - After crossing FreezeRowsCount, all columns see their current draw channel changed to a second set of draw channels.
// - We only use the dummy draw channel so we can push a null clipping rectangle into it without affecting other channels, while simplifying per-row/per-cell overhead. It will be empty and discarded when merged.
@ -1232,13 +1232,13 @@ void ImGui::TableSetColumnWidth(ImGuiTable* table, ImGuiTableColumn* column_0, f
//
// Each column itself can use 1 channel (row freeze disabled) or 2 channels (row freeze enabled).
// When the contents of a column didn't stray off its limit, we move its channels into the corresponding group
// based on its position (within frozen rows/columns set or not).
// based on its position (within frozen rows/columns groups or not).
// At the end of the operation our 1-4 groups will each have a ImDrawCmd using the same ClipRect, and they will be merged by the DrawSplitter.Merge() call.
//
// Column channels will not be merged into one of the 1-4 groups in the following cases:
// - The contents stray off its clipping rectangle (we only compare the MaxX value, not the MinX value).
// Direct ImDrawList calls won't be noticed so if you use them make sure the ImGui:: bounds matches, by e.g. calling SetCursorScreenPos().
// - The channel uses more than one draw command itself (we drop all our merging stuff here.. we could do better but it's going to be rare)
// Direct ImDrawList calls won't be taken into account by default, if you use them make sure the ImGui:: bounds matches, by e.g. calling SetCursorScreenPos().
// - The channel uses more than one draw command itself. We drop all our merging stuff here.. we could do better but it's going to be rare.
//
// This function is particularly tricky to understand.. take a breath.
// If we end with a single set and hosted by the outer window, we'll attempt to merge our draw command with
// If we end with a single group and hosted by the outer window, we'll attempt to merge our draw command with
// the existing outer window command. But we can only do so if our columns all fit within the expected clip rect,
// otherwise clipping will be incorrect when ScrollX is disabled.
// FIXME-TABLE FIXME-WORKRECT: We are wasting a merge opportunity on tables without scrolling if column don't fit within host clip rect, solely because of the half-padding difference between window->WorkRect and window->InnerClipRect