mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-19 06:26:35 +00:00
Internals: BringWindowToFront() iterate front to back, faster in majority of use cases.
This commit is contained in:
parent
3d24a9eb40
commit
2874aabb93
@ -5123,10 +5123,10 @@ void ImGui::BringWindowToFront(ImGuiWindow* window)
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.Windows.back() == window)
|
||||
return;
|
||||
for (int i = 0; i < g.Windows.Size; i++)
|
||||
for (int i = g.Windows.Size - 2; i >= 0; i--) // We can ignore the front most window
|
||||
if (g.Windows[i] == window)
|
||||
{
|
||||
g.Windows.erase(g.Windows.begin() + i);
|
||||
g.Windows.erase(g.Windows.Data + i);
|
||||
g.Windows.push_back(window);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user