From 7b433605f93a368647e25d190a62faabf8be256d Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 25 Apr 2018 15:38:19 +0200 Subject: [PATCH] Viewport: Avoid creating viewport on drag (fix cc882b07239b28b1dab6d46af72d3a463c92254a) --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index f0689f66..19bdfe0d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6229,7 +6229,8 @@ static void ImGui::UpdateSelectWindowViewport(ImGuiWindow* window) } else if (!window->ViewportOwned && g.MovingWindow && g.MovingWindow->RootWindow == window && IsMousePosValid()) { - window->Viewport = AddUpdateViewport(window, window->ID, window->Pos, window->Size, ImGuiViewportFlags_NoDecoration | ImGuiViewportFlags_NoFocusOnAppearing | ImGuiViewportFlags_NoInputs); + if (!window->Viewport->GetRect().Contains(window->Rect())) + window->Viewport = AddUpdateViewport(window, window->ID, window->Pos, window->Size, ImGuiViewportFlags_NoDecoration | ImGuiViewportFlags_NoFocusOnAppearing | ImGuiViewportFlags_NoInputs); } else if (!window->ViewportOwned && GetWindowAlwaysWantOwnViewport(window)) {