mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Columns:: columns set with no implicit id include the columns count into the id to avoid collisions (#125)
This commit is contained in:
parent
807d4ff92c
commit
e4ba6e525b
@ -8881,10 +8881,13 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
|
||||
}
|
||||
}
|
||||
|
||||
// Set state for first column
|
||||
ImGui::PushID(0x11223344); // Differentiate column ID with an arbitrary/random prefix for cases where users name their columns set the same as another non-scope widget
|
||||
window->DC.ColumnsSetID = window->GetID(id ? id : "");
|
||||
// Differentiate column ID with an arbitrary prefix for cases where users name their columns set the same as another widget.
|
||||
// In addition, when an identifier isn't explicitly provided we include the number of columns in the hash to make it uniquer.
|
||||
ImGui::PushID(0x11223347 + (id ? 0 : columns_count));
|
||||
window->DC.ColumnsSetID = window->GetID(id ? id : "columns");
|
||||
ImGui::PopID();
|
||||
|
||||
// Set state for first column
|
||||
window->DC.ColumnsCurrent = 0;
|
||||
window->DC.ColumnsCount = columns_count;
|
||||
window->DC.ColumnsShowBorders = border;
|
||||
|
Loading…
Reference in New Issue
Block a user