mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 21:39:54 +02:00
Docking: Kept ImGuiDockNodeFlags_PassthruDockspace and removed ImGuiDockNodeFlags_PassthruInEmptyNodes, ImGuiDockNodeFlags_RenderWindowBg. Doesn't include ImGuiDockNodeFlags_NoDockingInCentralNode. (#2109)
This commit is contained in:
11
imgui.cpp
11
imgui.cpp
@ -10197,7 +10197,6 @@ void ImGui::DockContextProcessUndockWindow(ImGuiContext* ctx, ImGuiWindow* windo
|
||||
|
||||
void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
|
||||
{
|
||||
(void)ctx;
|
||||
IM_ASSERT(node->IsLeafNode());
|
||||
IM_ASSERT(node->Windows.Size >= 1);
|
||||
|
||||
@ -10695,9 +10694,9 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
|
||||
if (g.NavWindow && g.NavWindow->RootWindowDockStop->DockNode && g.NavWindow->RootWindowDockStop->ParentWindow == host_window)
|
||||
node->LastFocusedNodeID = g.NavWindow->RootWindowDockStop->DockNode->ID;
|
||||
|
||||
// We need to draw a background if requested by ImGuiDockNodeFlags_RenderWindowBg, but we will only know the correct pos/size after
|
||||
// We need to draw a background if requested by ImGuiDockNodeFlags_PassthruDockspace, but we will only know the correct pos/size after
|
||||
// processing the resizing splitters. So we are using the DrawList channel splitting facility to submit drawing primitives out of order!
|
||||
const bool render_dockspace_bg = node->IsRootNode() && host_window && (node->Flags & ImGuiDockNodeFlags_RenderWindowBg) != 0;
|
||||
const bool render_dockspace_bg = node->IsRootNode() && host_window && (node->Flags & ImGuiDockNodeFlags_PassthruDockspace) != 0;
|
||||
if (render_dockspace_bg)
|
||||
{
|
||||
host_window->DrawList->ChannelsSplit(2);
|
||||
@ -10705,7 +10704,7 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
|
||||
}
|
||||
|
||||
// Register a hit-test hole in the window unless we are currently dragging a window that is compatible our dockspace
|
||||
bool central_node_hole = node->IsRootNode() && host_window && (node->Flags & ImGuiDockNodeFlags_PassthruInEmptyNodes) != 0 && central_node != NULL && central_node->IsEmpty();
|
||||
bool central_node_hole = node->IsRootNode() && host_window && (node->Flags & ImGuiDockNodeFlags_PassthruDockspace) != 0 && central_node != NULL && central_node->IsEmpty();
|
||||
bool central_node_hole_register_hit_test_hole = central_node_hole;
|
||||
if (central_node_hole)
|
||||
if (const ImGuiPayload* payload = ImGui::GetDragDropPayload())
|
||||
@ -10732,10 +10731,10 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
|
||||
}
|
||||
|
||||
// Draw empty node background (currently can only be the Central Node)
|
||||
if (host_window && node->IsEmpty() && node->IsVisible && !(node->Flags & ImGuiDockNodeFlags_PassthruInEmptyNodes))
|
||||
if (host_window && node->IsEmpty() && node->IsVisible && !(node->Flags & ImGuiDockNodeFlags_PassthruDockspace))
|
||||
host_window->DrawList->AddRectFilled(node->Pos, node->Pos + node->Size, GetColorU32(ImGuiCol_DockingEmptyBg));
|
||||
|
||||
// Draw whole dockspace background if ImGuiDockNodeFlags_RenderWindowBg if set.
|
||||
// Draw whole dockspace background if ImGuiDockNodeFlags_PassthruDockspace if set.
|
||||
if (render_dockspace_bg && node->IsVisible)
|
||||
{
|
||||
host_window->DrawList->ChannelsSetCurrent(0);
|
||||
|
Reference in New Issue
Block a user