mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-24 00:26:36 +00:00
Fix invalid .ini file data persistently saving back on next save
This commit is contained in:
parent
f33eb89018
commit
6c11d7623e
12
imgui.cpp
12
imgui.cpp
@ -1116,11 +1116,13 @@ static void SaveSettings()
|
||||
return;
|
||||
for (size_t i = 0; i != g.Settings.size(); i++)
|
||||
{
|
||||
const ImGuiIniData* ini = g.Settings[i];
|
||||
fprintf(f, "[%s]\n", ini->Name);
|
||||
fprintf(f, "Pos=%d,%d\n", (int)ini->Pos.x, (int)ini->Pos.y);
|
||||
fprintf(f, "Size=%d,%d\n", (int)ini->Size.x, (int)ini->Size.y);
|
||||
fprintf(f, "Collapsed=%d\n", ini->Collapsed);
|
||||
const ImGuiIniData* settings = g.Settings[i];
|
||||
if (settings->Pos.x == FLT_MAX)
|
||||
continue;
|
||||
fprintf(f, "[%s]\n", settings->Name);
|
||||
fprintf(f, "Pos=%d,%d\n", (int)settings->Pos.x, (int)settings->Pos.y);
|
||||
fprintf(f, "Size=%d,%d\n", (int)settings->Size.x, (int)settings->Size.y);
|
||||
fprintf(f, "Collapsed=%d\n", settings->Collapsed);
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user