Tables: Fixed incorrect border height used for logic when resizing one of several synchronized instance of a same table ID, when instances have a different height. (#3955, #3565)
elseif(rect_type==TRT_ColumnsContentHeadersUsed){ImGuiTableColumn*c=&table->Columns[n];returnImRect(c->WorkMinX,table->InnerClipRect.Min.y,c->ContentMaxXHeadersUsed,table->InnerClipRect.Min.y+table->LastFirstRowHeight);}// Note: y1/y2 not always accurate
elseif(rect_type==TRT_ColumnsContentHeadersUsed){ImGuiTableColumn*c=&table->Columns[n];returnImRect(c->WorkMinX,table->InnerClipRect.Min.y,c->ContentMaxXHeadersUsed,table->InnerClipRect.Min.y+table_instance->LastFirstRowHeight);}// Note: y1/y2 not always accurate
@ -136,6 +136,7 @@ struct ImGuiTabBar; // Storage for a tab bar
structImGuiTabItem;// Storage for a tab item (within a tab bar)
structImGuiTable;// Storage for a table
structImGuiTableColumn;// Storage for one column of a table
structImGuiTableInstanceData;// Storage for one instance of a same table
structImGuiTableTempData;// Temporary storage for one table (one per table in the stack), shared between tables.
structImGuiTableSettings;// Storage for a table .ini settings
structImGuiTableColumnsSettings;// Storage for a column .ini settings
@ -2290,6 +2291,15 @@ struct ImGuiTableCellData
ImGuiTableColumnIdxColumn;// Column number
};
// Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs, does that needs they could be moved to ImGuiTableTempData ?)
structImGuiTableInstanceData
{
floatLastOuterHeight;// Outer height from last frame // FIXME: multi-instance issue (#3955)
floatLastFirstRowHeight;// Height of first row from last frame // FIXME: possible multi-instance issue?
// FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
structIMGUI_APIImGuiTable
{
@ -2332,8 +2342,6 @@ struct IMGUI_API ImGuiTable
floatCellPaddingY;
floatCellSpacingX1;// Spacing between non-bordered cells
floatCellSpacingX2;
floatLastOuterHeight;// Outer height from last frame
floatLastFirstRowHeight;// Height of first row from last frame
floatInnerWidth;// User value passed to BeginTable(), see comments at the top of BeginTable() for details.
floatColumnsGivenWidth;// Sum of current column width
floatColumnsAutoFitWidth;// Sum of ideal column width in order nothing to be clipped, used for auto-fitting and content width submission in outer window
@ -2353,6 +2361,8 @@ struct IMGUI_API ImGuiTable
ImGuiWindow*InnerWindow;// Window holding the table data (== OuterWindow or a child window)
ImDrawListSplitter*DrawSplitter;// Shortcut to TempData->DrawSplitter while in table. Isolate draw commands per columns to avoid switching clip rect constantly
ImGuiTableInstanceDataInstanceDataFirst;
ImVector<ImGuiTableInstanceData>InstanceDataExtra;// FIXME-OPT: Using a small-vector pattern would be good.
ImGuiTableColumnSortSpecsSortSpecsSingle;
ImVector<ImGuiTableColumnSortSpecs>SortSpecsMulti;// FIXME-OPT: Using a small-vector pattern would be good.
ImGuiTableSortSpecsSortSpecs;// Public facing sorts specs, this is what we return in TableGetSortSpecs()