Columns: Refactor: Moved ColumnsSet[] to window out of DC as they are persistent data for most + fix for pre C++11 compilers. (#125, #1499)

This commit is contained in:
omar
2017-12-13 19:21:21 +01:00
parent b016215c80
commit 4ae5c7e227
2 changed files with 15 additions and 15 deletions

View File

@ -10935,12 +10935,12 @@ void ImGui::PushColumnClipRect(int column_index)
static ImGuiColumnsSet* FindOrAddColumnsSet(ImGuiWindow* window, ImGuiID id)
{
for (int n = 0; n < window->DC.ColumnsSets.Size; n++)
if (window->DC.ColumnsSets[n].ID == id)
return &window->DC.ColumnsSets[n];
for (int n = 0; n < window->ColumnsStorage.Size; n++)
if (window->ColumnsStorage[n].ID == id)
return &window->ColumnsStorage[n];
window->DC.ColumnsSets.push_back(ImGuiColumnsSet());
ImGuiColumnsSet* columns = &window->DC.ColumnsSets.back();
window->ColumnsStorage.push_back(ImGuiColumnsSet());
ImGuiColumnsSet* columns = &window->ColumnsStorage.back();
columns->ID = id;
return columns;
}