mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-14 17:07:01 +00:00
Internals: SettingsHandlerWindow_ReadLine uses context parameter.
This commit is contained in:
parent
ae405b83a4
commit
a1c432d1ad
@ -9374,21 +9374,22 @@ static void* SettingsHandlerWindow_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*
|
||||
return (void*)settings;
|
||||
}
|
||||
|
||||
static void SettingsHandlerWindow_ReadLine(ImGuiContext*, ImGuiSettingsHandler*, void* entry, const char* line)
|
||||
static void SettingsHandlerWindow_ReadLine(ImGuiContext* ctx, ImGuiSettingsHandler*, void* entry, const char* line)
|
||||
{
|
||||
ImGuiContext& g = *ctx;
|
||||
ImGuiWindowSettings* settings = (ImGuiWindowSettings*)entry;
|
||||
float x, y;
|
||||
int i;
|
||||
if (sscanf(line, "Pos=%f,%f", &x, &y) == 2) settings->Pos = ImVec2(x, y);
|
||||
else if (sscanf(line, "Size=%f,%f", &x, &y) == 2) settings->Size = ImMax(ImVec2(x, y), GImGui->Style.WindowMinSize);
|
||||
else if (sscanf(line, "Size=%f,%f", &x, &y) == 2) settings->Size = ImMax(ImVec2(x, y), g.Style.WindowMinSize);
|
||||
else if (sscanf(line, "Collapsed=%d", &i) == 1) settings->Collapsed = (i != 0);
|
||||
}
|
||||
|
||||
static void SettingsHandlerWindow_WriteAll(ImGuiContext* imgui_ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
|
||||
static void SettingsHandlerWindow_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
|
||||
{
|
||||
// Gather data from windows that were active during this session
|
||||
// (if a window wasn't opened in this session we preserve its settings)
|
||||
ImGuiContext& g = *imgui_ctx;
|
||||
ImGuiContext& g = *ctx;
|
||||
for (int i = 0; i != g.Windows.Size; i++)
|
||||
{
|
||||
ImGuiWindow* window = g.Windows[i];
|
||||
|
Loading…
Reference in New Issue
Block a user