From 6e4d9599532360878469b61a383119b06f1cb46e Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 30 Sep 2015 21:30:27 +0200 Subject: [PATCH] Window: fixed window lower-right clipping limit so it plays more friendly with both OpenGL and DirectX coordinates. Not sure about this. Hmm. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 004cd1d6..1e752fcf 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3973,7 +3973,7 @@ 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 // 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(); - 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); + 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-window->WindowPadding.x*0.5f, window->Pos.y+window->Size.y); if ((flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_ShowBorders)) clip_rect.Min += ImVec2(1.0f,1.0f); clip_rect.Max.x -= window->ScrollbarY ? style.ScrollbarSize : 0.0f;