mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-06 06:25:54 +01:00
Tables: fixed a bug tracking topology changes (insert new columns in the middle) when the table is not Reorderable. (#9570, #9108, #9572)
This commit is contained in:
parent
ed73ef4e84
commit
68bd43b2b4
@ -76,6 +76,9 @@ Other Changes:
|
||||
- Tables:
|
||||
- Fixed a bug restoring correct .ini columns order when table use is Sortable
|
||||
but had no user changes. (regression from 1.92.9). (#9519, #9108)
|
||||
- Fixed a bug tracking topology changes (insert new columns in the middle)
|
||||
when the table is not _Reorderable: new columns would be ordered incorrectly.
|
||||
(#9570, #9108, #9572) [@lailoken]
|
||||
- InpuText:
|
||||
- Fixed a crash in some cases when using Home key in a WordWrap+ReadOnly field. (#9561)
|
||||
- Selectable:
|
||||
|
||||
@ -4107,6 +4107,12 @@ static int IMGUI_CDECL TableFixDisplayOrderComparer(const void* lhs, const void*
|
||||
// Fix invalid display order data: compact values (0,1,3 -> 0,1,2); preserve relative order (0,3,1 -> 0,2,1); deduplicate (0,4,1,1 -> 0,3,1,2)
|
||||
void ImGui::TableFixDisplayOrder(ImGuiTable* table)
|
||||
{
|
||||
if ((table->Flags & ImGuiTableFlags_Reorderable) == 0)
|
||||
{
|
||||
for (int n = 0; n < table->ColumnsCount; n++)
|
||||
table->DisplayOrderToIndex[n] = table->Columns[n].DisplayOrder = (ImGuiTableColumnIdx)n;
|
||||
return;
|
||||
}
|
||||
ImGuiContext& g = *GImGui;
|
||||
g.TempBuffer.reserve((int)(sizeof(ImGuiTableFixDisplayOrderColumnData) * table->ColumnsCount)); // FIXME: Maybe wrap those two lines as a helper.
|
||||
ImGuiTableFixDisplayOrderColumnData* fdo_columns = (ImGuiTableFixDisplayOrderColumnData*)(void*)g.TempBuffer.Data;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user