Tables: Locking IndentX per-row so multiple columns with IndentEnabled don't get indent shearing.

This commit is contained in:
omar
2020-03-19 14:55:42 +01:00
committed by ocornut
parent 5ffc9e0846
commit b7fa96679e
2 changed files with 18 additions and 16 deletions

View File

@ -1941,7 +1941,6 @@ struct ImGuiTableColumn
}
};
// FIXME-OPT: Since CountColumns is invariant, we could use a single alloc for ImGuiTable + the three vectors it is carrying.
struct ImGuiTable
{
ImGuiID ID;
@ -1965,6 +1964,7 @@ struct ImGuiTable
float RowPosY2;
float RowMinHeight; // Height submitted to TableNextRow()
float RowTextBaseline;
float RowIndentOffsetX;
ImGuiTableRowFlags RowFlags : 16; // Current row flags, see ImGuiTableRowFlags_
ImGuiTableRowFlags LastRowFlags : 16;
int RowBgColorCounter; // Counter for alternating background colors (can be fast-forwarded by e.g clipper)
@ -2259,11 +2259,11 @@ namespace ImGui
IMGUI_API void TableSortSpecsSanitize(ImGuiTable* table);
IMGUI_API void TableBeginRow(ImGuiTable* table);
IMGUI_API void TableEndRow(ImGuiTable* table);
IMGUI_API void TableBeginCell(ImGuiTable* table, int column_no);
IMGUI_API void TableBeginCell(ImGuiTable* table, int column_n);
IMGUI_API void TableEndCell(ImGuiTable* table);
IMGUI_API ImRect TableGetCellRect();
IMGUI_API const char* TableGetColumnName(ImGuiTable* table, int column_no);
IMGUI_API void TableSetColumnAutofit(ImGuiTable* table, int column_no);
IMGUI_API const char* TableGetColumnName(ImGuiTable* table, int column_n);
IMGUI_API void TableSetColumnAutofit(ImGuiTable* table, int column_n);
IMGUI_API void PushTableBackground();
IMGUI_API void PopTableBackground();
IMGUI_API void TableLoadSettings(ImGuiTable* table);