@@ -6207,6 +6207,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
6207
6207
6208
6208
// Update contents size from last frame for auto-fitting (or use explicit size)
6209
6209
CalcWindowContentSizes(window, &window->ContentSize, &window->ContentSizeIdeal);
6210
+
6211
+ // FIXME: These flags are decremented before they are used. This means that in order to have these fields produce their intended behaviors
6212
+ // for one frame we must set them to at least 2, which is counter-intuitive. HiddenFramesCannotSkipItems is a more complicated case because
6213
+ // it has a single usage before this code block and may be set below before it is finally checked.
6210
6214
if (window->HiddenFramesCanSkipItems > 0)
6211
6215
window->HiddenFramesCanSkipItems--;
6212
6216
if (window->HiddenFramesCannotSkipItems > 0)
@@ -12892,20 +12896,16 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
12892
12896
// This is mostly used for automation.
12893
12897
bool ImGui::DockContextCalcDropPosForDocking(ImGuiWindow* target, ImGuiDockNode* target_node, ImGuiWindow* payload, ImGuiDir split_dir, bool split_outer, ImVec2* out_pos)
12894
12898
{
12895
- if (split_outer)
12896
- {
12897
- IM_ASSERT(0);
12898
- }
12899
- else
12900
- {
12901
- ImGuiDockPreviewData split_data;
12902
- DockNodePreviewDockSetup(target, target_node, payload, &split_data, false, split_outer);
12903
- if (split_data.DropRectsDraw[split_dir+1].IsInverted())
12904
- return false;
12905
- *out_pos = split_data.DropRectsDraw[split_dir+1].GetCenter();
12906
- return true;
12907
- }
12908
- return false;
12899
+ // In DockNodePreviewDockSetup() for a root central node instead of showing both "inner" and "outer" drop rects
12900
+ // (which would be functionally identical) we only show the outer one. Reflect this here.
12901
+ if (target_node && target_node->ParentNode == NULL && target_node->IsCentralNode() && split_dir != ImGuiDir_None)
12902
+ split_outer = true;
12903
+ ImGuiDockPreviewData split_data;
12904
+ DockNodePreviewDockSetup(target, target_node, payload, &split_data, false, split_outer);
12905
+ if (split_data.DropRectsDraw[split_dir+1].IsInverted())
12906
+ return false;
12907
+ *out_pos = split_data.DropRectsDraw[split_dir+1].GetCenter();
12908
+ return true;
12909
12909
}
12910
12910
12911
12911
//-----------------------------------------------------------------------------
0 commit comments