mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Window clipping rect fixes (for child windows with borders among others)
This commit is contained in:
parent
f0aca186cc
commit
ad00d88923
@ -3906,9 +3906,11 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
|
|||||||
// We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame
|
// We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame
|
||||||
// Note that if our window is collapsed we will end up with a null clipping rectangle which is the correct behavior.
|
// Note that if our window is collapsed we will end up with a null clipping rectangle which is the correct behavior.
|
||||||
const ImRect title_bar_rect = window->TitleBarRect();
|
const ImRect title_bar_rect = window->TitleBarRect();
|
||||||
ImVec4 clip_rect(title_bar_rect.Min.x+0.5f+window->WindowPadding.x*0.5f, title_bar_rect.Max.y+window->MenuBarHeight()+0.5f, window->Rect().Max.x+0.5f-window->WindowPadding.x*0.5f, window->Rect().Max.y-1.5f);
|
ImRect clip_rect(title_bar_rect.Min.x+0.5f+window->WindowPadding.x*0.5f, title_bar_rect.Max.y+window->MenuBarHeight()+0.5f, window->Pos.x+window->Size.x+0.5f-window->WindowPadding.x*0.5f, window->Pos.y+window->Size.y+0.5f);
|
||||||
|
if ((flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_ShowBorders))
|
||||||
|
clip_rect.Min += ImVec2(1.0f,1.0f);
|
||||||
if (window->ScrollbarY)
|
if (window->ScrollbarY)
|
||||||
clip_rect.z -= style.ScrollbarWidth;
|
clip_rect.Max.x -= style.ScrollbarWidth;
|
||||||
PushClipRect(clip_rect);
|
PushClipRect(clip_rect);
|
||||||
|
|
||||||
// Clear 'accessed' flag last thing
|
// Clear 'accessed' flag last thing
|
||||||
|
Loading…
Reference in New Issue
Block a user