|
|
@ -3666,9 +3666,9 @@ static int ChildWindowComparer(const void* lhs, const void* rhs) |
|
|
|
return (a->BeginOrderWithinParent - b->BeginOrderWithinParent); |
|
|
|
} |
|
|
|
|
|
|
|
static void AddWindowToSortedBuffer(ImVector<ImGuiWindow*>& out_sorted_windows, ImGuiWindow* window) |
|
|
|
static void AddWindowToSortedBuffer(ImVector<ImGuiWindow*>* out_sorted_windows, ImGuiWindow* window) |
|
|
|
{ |
|
|
|
out_sorted_windows.push_back(window); |
|
|
|
out_sorted_windows->push_back(window); |
|
|
|
if (window->Active) |
|
|
|
{ |
|
|
|
int count = window->DC.ChildWindows.Size; |
|
|
@ -3869,7 +3869,7 @@ void ImGui::EndFrame() |
|
|
|
ImGuiWindow* window = g.Windows[i]; |
|
|
|
if (window->Active && (window->Flags & ImGuiWindowFlags_ChildWindow)) // if a child is active its parent will add it
|
|
|
|
continue; |
|
|
|
AddWindowToSortedBuffer(g.WindowsSortBuffer, window); |
|
|
|
AddWindowToSortedBuffer(&g.WindowsSortBuffer, window); |
|
|
|
} |
|
|
|
|
|
|
|
IM_ASSERT(g.Windows.Size == g.WindowsSortBuffer.Size); // we done something wrong
|
|
|
@ -5489,7 +5489,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) |
|
|
|
{ |
|
|
|
// Adjust passed "client size" to become a "window size"
|
|
|
|
window->SizeContentsExplicit = g.NextWindowData.ContentSizeVal; |
|
|
|
window->SizeContentsExplicit.y += window->TitleBarHeight() + window->MenuBarHeight(); |
|
|
|
if (window->SizeContentsExplicit.y != 0.0f) |
|
|
|
window->SizeContentsExplicit.y += window->TitleBarHeight() + window->MenuBarHeight(); |
|
|
|
g.NextWindowData.ContentSizeCond = 0; |
|
|
|
} |
|
|
|
else if (first_begin_of_the_frame) |
|
|
@ -5615,9 +5616,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) |
|
|
|
float size_x_for_scrollbars = size_full_modified.x != FLT_MAX ? window->SizeFull.x : window->SizeFullAtLastBegin.x; |
|
|
|
float size_y_for_scrollbars = size_full_modified.y != FLT_MAX ? window->SizeFull.y : window->SizeFullAtLastBegin.y; |
|
|
|
window->ScrollbarY = (flags & ImGuiWindowFlags_AlwaysVerticalScrollbar) || ((window->SizeContents.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar)); |
|
|
|
window->ScrollbarX = (flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar) || ((window->SizeContents.x > size_x_for_scrollbars - (window->ScrollbarY ? style.ScrollbarSize : 0.0f) - window->WindowPadding.x) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar)); |
|
|
|
window->ScrollbarX = (flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar) || ((window->SizeContents.x > size_x_for_scrollbars - (window->ScrollbarY ? style.ScrollbarSize : 0.0f)) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar)); |
|
|
|
if (window->ScrollbarX && !window->ScrollbarY) |
|
|
|
window->ScrollbarY = (window->SizeContents.y > size_y_for_scrollbars + style.ScrollbarSize) && !(flags & ImGuiWindowFlags_NoScrollbar); |
|
|
|
window->ScrollbarY = (window->SizeContents.y > size_y_for_scrollbars - style.ScrollbarSize) && !(flags & ImGuiWindowFlags_NoScrollbar); |
|
|
|
window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->ScrollbarX ? style.ScrollbarSize : 0.0f); |
|
|
|
} |
|
|
|
|
|
|
|