Internals: renaming IndexWithinParent to OrderWithinParent

This commit is contained in:
omar 2017-07-20 21:25:31 +08:00
parent 25f3717a1c
commit 85d9c8fb46
2 changed files with 5 additions and 5 deletions

View File

@ -1776,7 +1776,7 @@ ImGuiWindow::ImGuiWindow(const char* name)
MoveId = GetID("#MOVE"); MoveId = GetID("#MOVE");
Flags = 0; Flags = 0;
IndexWithinParent = 0; OrderWithinParent = 0;
PosFloat = Pos = ImVec2(0.0f, 0.0f); PosFloat = Pos = ImVec2(0.0f, 0.0f);
Size = SizeFull = ImVec2(0.0f, 0.0f); Size = SizeFull = ImVec2(0.0f, 0.0f);
SizeContents = SizeContentsExplicit = ImVec2(0.0f, 0.0f); SizeContents = SizeContentsExplicit = ImVec2(0.0f, 0.0f);
@ -2568,7 +2568,7 @@ static int ChildWindowComparer(const void* lhs, const void* rhs)
return d; return d;
if (int d = (a->Flags & ImGuiWindowFlags_ComboBox) - (b->Flags & ImGuiWindowFlags_ComboBox)) if (int d = (a->Flags & ImGuiWindowFlags_ComboBox) - (b->Flags & ImGuiWindowFlags_ComboBox))
return d; return d;
return (a->IndexWithinParent - b->IndexWithinParent); return (a->OrderWithinParent - b->OrderWithinParent);
} }
static void AddWindowToSortedBuffer(ImVector<ImGuiWindow*>& out_sorted_windows, ImGuiWindow* window) static void AddWindowToSortedBuffer(ImVector<ImGuiWindow*>& out_sorted_windows, ImGuiWindow* window)
@ -3991,7 +3991,7 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
if (first_begin_of_the_frame) if (first_begin_of_the_frame)
{ {
window->Active = true; window->Active = true;
window->IndexWithinParent = 0; window->OrderWithinParent = 0;
window->BeginCount = 0; window->BeginCount = 0;
window->ClipRect = ImVec4(-FLT_MAX,-FLT_MAX,+FLT_MAX,+FLT_MAX); window->ClipRect = ImVec4(-FLT_MAX,-FLT_MAX,+FLT_MAX,+FLT_MAX);
window->LastFrameActive = current_frame; window->LastFrameActive = current_frame;
@ -4111,7 +4111,7 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
// Position child window // Position child window
if (flags & ImGuiWindowFlags_ChildWindow) if (flags & ImGuiWindowFlags_ChildWindow)
{ {
window->IndexWithinParent = parent_window->DC.ChildWindows.Size; window->OrderWithinParent = parent_window->DC.ChildWindows.Size;
parent_window->DC.ChildWindows.push_back(window); parent_window->DC.ChildWindows.push_back(window);
} }
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup)) if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup))

View File

@ -620,7 +620,7 @@ struct IMGUI_API ImGuiWindow
char* Name; char* Name;
ImGuiID ID; // == ImHash(Name) ImGuiID ID; // == ImHash(Name)
ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_ ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_
int IndexWithinParent; // Order within immediate parent window, if we are a child window. Otherwise 0. int OrderWithinParent; // Order within immediate parent window, if we are a child window. Otherwise 0.
ImVec2 PosFloat; ImVec2 PosFloat;
ImVec2 Pos; // Position rounded-up to nearest pixel ImVec2 Pos; // Position rounded-up to nearest pixel
ImVec2 Size; // Current size (==SizeFull or collapsed title bar size) ImVec2 Size; // Current size (==SizeFull or collapsed title bar size)