Internals: DrawData: We don't need an intermediate layer for popups.

This commit is contained in:
omar 2018-01-15 18:00:13 +01:00
parent 0c06b43e6b
commit 1182174d81
2 changed files with 1 additions and 3 deletions

View File

@ -2895,8 +2895,6 @@ static void AddWindowToDrawDataSelectLayer(ImDrawDataBuilder* builder, ImGuiWind
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
g.IO.MetricsActiveWindows++; g.IO.MetricsActiveWindows++;
if (window->Flags & ImGuiWindowFlags_Tooltip) if (window->Flags & ImGuiWindowFlags_Tooltip)
AddWindowToRenderList(&builder->Layers[2], window);
else if (window->Flags & ImGuiWindowFlags_Popup)
AddWindowToRenderList(&builder->Layers[1], window); AddWindowToRenderList(&builder->Layers[1], window);
else else
AddWindowToRenderList(&builder->Layers[0], window); AddWindowToRenderList(&builder->Layers[0], window);

View File

@ -465,7 +465,7 @@ struct IMGUI_API ImDrawListSharedData
struct ImDrawDataBuilder struct ImDrawDataBuilder
{ {
ImVector<ImDrawList*> Layers[3]; // Layered for: regular, popup, tooltip ImVector<ImDrawList*> Layers[2]; // Global layers for: regular, tooltip
void Clear() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); } void Clear() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); }
void ClearFreeMemory() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); } void ClearFreeMemory() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); }