mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-09 23:54:20 +00:00
Docking: moving redundant clears in one place for simplicity.
This commit is contained in:
parent
00dfb3c896
commit
01a4cff8f9
1 changed files with 6 additions and 11 deletions
17
imgui.cpp
17
imgui.cpp
|
|
@ -7786,10 +7786,12 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||
SetWindowDock(window, g.NextWindowData.DockId, g.NextWindowData.DockCond);
|
||||
if (first_begin_of_the_frame)
|
||||
{
|
||||
bool has_dock_node = (window->DockId != 0 || window->DockNode != NULL);
|
||||
bool new_auto_dock_node = !has_dock_node && GetWindowAlwaysWantOwnTabBar(window);
|
||||
bool dock_node_was_visible = window->DockNodeIsVisible;
|
||||
bool dock_tab_was_visible = window->DockTabIsVisible;
|
||||
const bool has_dock_node = (window->DockId != 0 || window->DockNode != NULL);
|
||||
const bool new_auto_dock_node = !has_dock_node && GetWindowAlwaysWantOwnTabBar(window);
|
||||
const bool dock_node_was_visible = window->DockNodeIsVisible;
|
||||
const bool dock_tab_was_visible = window->DockTabIsVisible;
|
||||
window->DockIsActive = window->DockNodeIsVisible = window->DockTabIsVisible = false;
|
||||
|
||||
if (has_dock_node || new_auto_dock_node)
|
||||
{
|
||||
BeginDocked(window, p_open);
|
||||
|
|
@ -7807,10 +7809,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||
SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
window->DockIsActive = window->DockNodeIsVisible = window->DockTabIsVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Parent window is latched only on the first call to Begin() of the frame, so further append-calls can be done from a different window stack
|
||||
|
|
@ -20991,9 +20989,6 @@ void ImGui::BeginDocked(ImGuiWindow* window, bool* p_open)
|
|||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
|
||||
// Clear fields ahead so most early-out paths don't have to do it
|
||||
window->DockIsActive = window->DockNodeIsVisible = window->DockTabIsVisible = false;
|
||||
|
||||
// Specific extra processing for fallback window (#9151), could be in Begin() as well.
|
||||
if (window->IsFallbackWindow && !window->WasActive)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue