mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 03:47:00 +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;
|
return;
|
||||||
for (size_t i = 0; i != g.Settings.size(); i++)
|
for (size_t i = 0; i != g.Settings.size(); i++)
|
||||||
{
|
{
|
||||||
const ImGuiIniData* ini = g.Settings[i];
|
const ImGuiIniData* settings = g.Settings[i];
|
||||||
fprintf(f, "[%s]\n", ini->Name);
|
if (settings->Pos.x == FLT_MAX)
|
||||||
fprintf(f, "Pos=%d,%d\n", (int)ini->Pos.x, (int)ini->Pos.y);
|
continue;
|
||||||
fprintf(f, "Size=%d,%d\n", (int)ini->Size.x, (int)ini->Size.y);
|
fprintf(f, "[%s]\n", settings->Name);
|
||||||
fprintf(f, "Collapsed=%d\n", ini->Collapsed);
|
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");
|
fprintf(f, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user