Browse Source

Viewport: Fix handling of PlatformRequestResize/PlatformRequestPos. when OS decoration are enabled via ImGuiConfigFlags_ViewportsDecoration .

omar 6 years ago
parent
commit
ac52d9d44c
1 changed files with 4 additions and 2 deletions
  1. 4 2
      imgui.cpp

+ 4 - 2
imgui.cpp

@@ -7435,8 +7435,10 @@ ImGuiViewportP* ImGui::AddUpdateViewport(ImGuiWindow* window, ImGuiID id, const
     ImGuiViewportP* viewport = (ImGuiViewportP*)FindViewportByID(id);
     if (viewport)
     {
-        viewport->Pos = pos;
-        viewport->Size = size;
+        if (!viewport->PlatformRequestMove)
+            viewport->Pos = pos;
+        if (!viewport->PlatformRequestResize)
+            viewport->Size = size;
     }
     else
     {