From 9ac8820ee2ad3b569b592519a50b6dad4607eb04 Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 8 Nov 2017 22:32:22 +0100 Subject: [PATCH] Fixed non-pixel aligned bounding box of window resize grip, / which triumphally led to any re-arrangement of operations inside the resize grip code outputting non-exact size_target values which led to unstable window position because clamping code uses size in a subtraction, etc etc. Lovely how a whole system can be made to act weird with a single bad input. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index d9ccc433..0ded20c0 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4386,7 +4386,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Manual resize // Using the FlattenChilds button flag, we make the resize button accessible even if we are hovering over a child window const ImVec2 br = window->Rect().GetBR(); - const ImRect resize_rect(br - ImVec2(resize_corner_size * 0.75f, resize_corner_size * 0.75f), br); + const ImRect resize_rect(br - ImFloor(ImVec2(resize_corner_size * 0.75f, resize_corner_size * 0.75f)), br); const ImGuiID resize_id = window->GetID("#RESIZE"); bool hovered, held; ButtonBehavior(resize_rect, resize_id, &hovered, &held, ImGuiButtonFlags_FlattenChilds);