Internals: Storing settings using ImVec2ih to match what we are doing with dock node. + removed ImMax from reading Size value (done in Begin) + removed seemingly unnecessary FLT_MAX compare in SettingsHandlerWindow_WriteAll.

About: Added backquote to text copied into clipboard so it doesn't mess up with github formatting when pasted.
This commit is contained in:
omar
2019-08-23 11:08:30 +02:00
parent c4ff1b3578
commit cb538fadfe
3 changed files with 28 additions and 17 deletions

View File

@ -528,6 +528,14 @@ struct ImVec1
ImVec1(float _x) { x = _x; }
};
// 2D vector (half-size integer)
struct ImVec2ih
{
short x, y;
ImVec2ih() { x = y = 0; }
ImVec2ih(short _x, short _y) { x = _x; y = _y; }
};
// 2D axis aligned bounding-box
// NB: we can't rely on ImVec2 math operators being available here
struct IMGUI_API ImRect
@ -655,11 +663,11 @@ struct ImGuiWindowSettings
{
char* Name;
ImGuiID ID;
ImVec2 Pos;
ImVec2 Size;
ImVec2ih Pos;
ImVec2ih Size;
bool Collapsed;
ImGuiWindowSettings() { Name = NULL; ID = 0; Pos = Size = ImVec2(0,0); Collapsed = false; }
ImGuiWindowSettings() { Name = NULL; ID = 0; Pos = Size = ImVec2ih(0, 0); Collapsed = false; }
};
struct ImGuiSettingsHandler