@@ -4827,10 +4827,10 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
4827
4827
// Retrieve settings from .ini file
4828
4828
window->SettingsIdx = g.SettingsWindows.index_from_ptr(settings);
4829
4829
SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false);
4830
- window->Pos = ImFloor (settings->Pos);
4830
+ window->Pos = ImVec2 (settings->Pos.x, settings->Pos.y );
4831
4831
window->Collapsed = settings->Collapsed;
4832
- if (ImLengthSqr( settings->Size) > 0.00001f )
4833
- size = ImFloor (settings->Size);
4832
+ if (settings->Size.x > 0 && settings->Size.y > 0 )
4833
+ size = ImVec2 (settings->Size.x, settings->Size.y );
4834
4834
}
4835
4835
window->Size = window->SizeFull = ImFloor(size);
4836
4836
window->DC.CursorStartPos = window->DC.CursorMaxPos = window->Pos; // So first call to CalcContentSize() doesn't return crazy values
@@ -9447,14 +9447,13 @@ static void* SettingsHandlerWindow_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*
9447
9447
return (void*)settings;
9448
9448
}
9449
9449
9450
- static void SettingsHandlerWindow_ReadLine(ImGuiContext* ctx , ImGuiSettingsHandler*, void* entry, const char* line)
9450
+ static void SettingsHandlerWindow_ReadLine(ImGuiContext*, ImGuiSettingsHandler*, void* entry, const char* line)
9451
9451
{
9452
- ImGuiContext& g = *ctx;
9453
9452
ImGuiWindowSettings* settings = (ImGuiWindowSettings*)entry;
9454
- float x, y;
9453
+ int x, y;
9455
9454
int i;
9456
- if (sscanf(line, "Pos=%f,%f ", &x, &y) == 2) settings->Pos = ImVec2( x, y);
9457
- else if (sscanf(line, "Size=%f,%f ", &x, &y) == 2) settings->Size = ImMax(ImVec2( x, y), g.Style.WindowMinSize );
9455
+ if (sscanf(line, "Pos=%i,%i ", &x, &y) == 2) settings->Pos = ImVec2ih((short) x, (short) y);
9456
+ else if (sscanf(line, "Size=%i,%i ", &x, &y) == 2) settings->Size = ImVec2ih((short) x, (short)y );
9458
9457
else if (sscanf(line, "Collapsed=%d", &i) == 1) settings->Collapsed = (i != 0);
9459
9458
}
9460
9459
@@ -9476,8 +9475,8 @@ static void SettingsHandlerWindow_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
9476
9475
window->SettingsIdx = g.SettingsWindows.index_from_ptr(settings);
9477
9476
}
9478
9477
IM_ASSERT(settings->ID == window->ID);
9479
- settings->Pos = window->Pos;
9480
- settings->Size = window->SizeFull;
9478
+ settings->Pos = ImVec2ih((short) window->Pos.x, (short)window->Pos.y) ;
9479
+ settings->Size = ImVec2ih((short) window->SizeFull.x, (short)window->SizeFull.y) ;
9481
9480
settings->Collapsed = window->Collapsed;
9482
9481
}
9483
9482
@@ -9486,11 +9485,9 @@ static void SettingsHandlerWindow_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
9486
9485
for (int i = 0; i != g.SettingsWindows.Size; i++)
9487
9486
{
9488
9487
const ImGuiWindowSettings* settings = &g.SettingsWindows[i];
9489
- if (settings->Pos.x == FLT_MAX)
9490
- continue;
9491
9488
buf->appendf("[%s][%s]\n", handler->TypeName, settings->Name);
9492
- buf->appendf("Pos=%d,%d\n", (int) settings->Pos.x, (int) settings->Pos.y);
9493
- buf->appendf("Size=%d,%d\n", (int) settings->Size.x, (int) settings->Size.y);
9489
+ buf->appendf("Pos=%d,%d\n", settings->Pos.x, settings->Pos.y);
9490
+ buf->appendf("Size=%d,%d\n", settings->Size.x, settings->Size.y);
9494
9491
buf->appendf("Collapsed=%d\n", settings->Collapsed);
9495
9492
buf->appendf("\n");
9496
9493
}
0 commit comments