@@ -1833,15 +1833,13 @@ bool Begin(const char* name, bool* open, ImVec2 size, float fill_alpha, ImGuiWin
1833
1833
parent_window->DC .ChildWindows .push_back (window);
1834
1834
window->Pos = window->PosFloat = parent_window->DC .CursorPos ;
1835
1835
window->SizeFull = size;
1836
- if (!(flags & ImGuiWindowFlags_ComboBox))
1837
- ImGui::PushClipRect (parent_window->ClipRectStack .back ());
1838
- else
1839
- ImGui::PushClipRect (ImVec4 (0 .0f , 0 .0f , g.IO .DisplaySize .x , g.IO .DisplaySize .y ));
1840
1836
}
1837
+
1838
+ // Outer clipping rectangle
1839
+ if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_ComboBox))
1840
+ ImGui::PushClipRect (g.CurrentWindowStack [g.CurrentWindowStack .size ()-2 ]->ClipRectStack .back ());
1841
1841
else
1842
- {
1843
1842
ImGui::PushClipRect (ImVec4 (0 .0f , 0 .0f , g.IO .DisplaySize .x , g.IO .DisplaySize .y ));
1844
- }
1845
1843
1846
1844
// ID stack
1847
1845
window->IDStack .resize (0 );
@@ -2082,8 +2080,16 @@ bool Begin(const char* name, bool* open, ImVec2 size, float fill_alpha, ImGuiWin
2082
2080
ImGui::CloseWindowButton (open );
2083
2081
}
2084
2082
}
2083
+ else
2084
+ {
2085
+ // Outer clipping rectangle
2086
+ if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_ComboBox))
2087
+ ImGui::PushClipRect (g.CurrentWindowStack [g.CurrentWindowStack .size ()-2 ]->ClipRectStack .back ());
2088
+ else
2089
+ ImGui::PushClipRect (ImVec4 (0 .0f , 0 .0f , g.IO .DisplaySize .x , g.IO .DisplaySize .y ));
2090
+ }
2085
2091
2086
- // Clip rectangle
2092
+ // Innter clipping rectangle
2087
2093
// We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame
2088
2094
const ImGuiAabb title_bar_aabb = window->TitleBarAabb ();
2089
2095
ImVec4 clip_rect (title_bar_aabb.Min .x +0 .5f , title_bar_aabb.Max .y +0 .5f , window->Aabb ().Max .x -1 .5f , window->Aabb ().Max .y -1 .5f );
0 commit comments