mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-14 17:07:01 +00:00
Viewports: Fixed translating a host viewport from briefly altering the size of AlwaysAutoResize windows. (#5057)
This commit is contained in:
parent
64519c6875
commit
8639a2f9f8
@ -134,6 +134,7 @@ Docking+Viewports Branch:
|
||||
|
||||
- Docking: Fixed floating docked nodes not being clamped into viewport workrect to stay reachable
|
||||
when g.ConfigWindowsMoveFromTitleBarOnly is set and multi-viewports are disabled. (#5044)
|
||||
- Viewports: Fixed translating a host viewport from briefly altering the size of AlwaysAutoResize windows. (#5057)
|
||||
- Viewports: Fixed main viewport size not matching ImDrawData::DisplaySize for one frame during resize
|
||||
when multi-viewports are disabled. (#4900)
|
||||
|
||||
|
@ -4063,6 +4063,8 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
|
||||
}
|
||||
}
|
||||
|
||||
// This is called during NewFrame()->UpdateViewportsNewFrame() only.
|
||||
// Need to keep in sync with SetWindowPos()
|
||||
static void TranslateWindow(ImGuiWindow* window, const ImVec2& delta)
|
||||
{
|
||||
window->Pos += delta;
|
||||
@ -4072,6 +4074,7 @@ static void TranslateWindow(ImGuiWindow* window, const ImVec2& delta)
|
||||
window->DC.CursorPos += delta;
|
||||
window->DC.CursorStartPos += delta;
|
||||
window->DC.CursorMaxPos += delta;
|
||||
window->DC.IdealMaxPos += delta;
|
||||
}
|
||||
|
||||
static void ScaleWindow(ImGuiWindow* window, float scale)
|
||||
@ -7670,6 +7673,7 @@ void ImGui::SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond)
|
||||
const ImVec2 old_pos = window->Pos;
|
||||
window->Pos = ImFloor(pos);
|
||||
ImVec2 offset = window->Pos - old_pos;
|
||||
// FIXME: share code with TranslateWindow(), need to confirm whether the 3 rect modified by TranslateWindow() are desirable here.
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user