Internals: Using simpler ImVec2ih construct + fixed misnamed member.

This commit is contained in:
omar
2019-08-23 12:31:14 +02:00
parent e1fca8d982
commit 483534b525
2 changed files with 20 additions and 19 deletions

View File

@ -544,8 +544,9 @@ struct ImVec1
struct ImVec2ih
{
short x, y;
ImVec2ih() { x = y = 0; }
ImVec2ih(short _x, short _y) { x = _x; y = _y; }
ImVec2ih() { x = y = 0; }
ImVec2ih(short _x, short _y) { x = _x; y = _y; }
explicit ImVec2ih(const ImVec2& rhs) { x = (short)rhs.x; y = (short)rhs.y; }
};
// 2D axis aligned bounding-box
@ -677,14 +678,14 @@ struct ImGuiWindowSettings
ImGuiID ID;
ImVec2ih Pos; // NB: Settings position are stored RELATIVE to the viewport! Whereas runtime ones are absolute positions.
ImVec2ih Size;
ImVec2ih ViewportPosh;
ImVec2ih ViewportPos;
ImGuiID ViewportId;
ImGuiID DockId; // ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none.
ImGuiID ClassId; // ID of window class if specified
short DockOrder; // Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
bool Collapsed;
ImGuiWindowSettings() { Name = NULL; ID = 0; Pos = Size = ViewportPosh = ImVec2ih(0, 0); ViewportId = DockId = ClassId = 0; DockOrder = -1; Collapsed = false; }
ImGuiWindowSettings() { Name = NULL; ID = 0; Pos = Size = ViewportPos = ImVec2ih(0, 0); ViewportId = DockId = ClassId = 0; DockOrder = -1; Collapsed = false; }
};
struct ImGuiSettingsHandler
@ -1210,7 +1211,7 @@ struct ImGuiContext
{
Initialized = false;
FrameScopeActive = FrameScopePushedFallbackWindow = false;
ConfigFlagsCurrFrame = ImGuiConfigFlags_None;
ConfigFlagsCurrFrame = ConfigFlagsLastFrame = ImGuiConfigFlags_None;
Font = NULL;
FontSize = FontBaseSize = 0.0f;
FontAtlasOwnedByContext = shared_font_atlas ? false : true;