소스 검색

Made the ImGuiWindowFlags_NoMove flag inherited from parent to child, so in a setup with RootWindow (no flag) -> Child (NoMove flag) -> SubChild (no flag) user won't be able to move the root window by clicking on SubChild. (#1381)

omar 8 년 전
부모
커밋
e6f06627e9
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      imgui.cpp

+ 1 - 0
imgui.cpp

@@ -3785,6 +3785,7 @@ static bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
 {
 {
     ImGuiWindow* parent_window = ImGui::GetCurrentWindow();
     ImGuiWindow* parent_window = ImGui::GetCurrentWindow();
     ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_ChildWindow;
     ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_ChildWindow;
+    flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove);  // Inherit the NoMove flag
 
 
     const ImVec2 content_avail = ImGui::GetContentRegionAvail();
     const ImVec2 content_avail = ImGui::GetContentRegionAvail();
     ImVec2 size = ImFloor(size_arg);
     ImVec2 size = ImFloor(size_arg);