Menus: Fixed an issue with child-menu auto-sizing (issue introduced by 6af92b0) (#3779)

This commit is contained in:
ocornut
2021-02-02 13:06:51 +01:00
parent 929563c3a7
commit a3f0393351
4 changed files with 6 additions and 4 deletions

View File

@ -6576,6 +6576,7 @@ void ImGui::SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond)
ImVec2 offset = window->Pos - old_pos;
window->DC.CursorPos += offset; // As we happen to move the window while it is being appended to (which is a bad idea - will smear) let's at least offset the cursor
window->DC.CursorMaxPos += offset; // And more importantly we need to offset CursorMaxPos/CursorStartPos this so ContentSize calculation doesn't get affected.
window->DC.IdealMaxPos += offset;
window->DC.CursorStartPos += offset;
}