mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
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)
This commit is contained in:
parent
7b0d58c5e5
commit
64519c6875
@ -132,6 +132,8 @@ Other Changes:
|
|||||||
|
|
||||||
Docking+Viewports Branch:
|
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 main viewport size not matching ImDrawData::DisplaySize for one frame during resize
|
- Viewports: Fixed main viewport size not matching ImDrawData::DisplaySize for one frame during resize
|
||||||
when multi-viewports are disabled. (#4900)
|
when multi-viewports are disabled. (#4900)
|
||||||
|
|
||||||
|
@ -6015,8 +6015,8 @@ static inline void ClampWindowRect(ImGuiWindow* window, const ImRect& visibility
|
|||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
ImVec2 size_for_clamping = window->Size;
|
ImVec2 size_for_clamping = window->Size;
|
||||||
if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(window->Flags & ImGuiWindowFlags_NoTitleBar))
|
if (g.IO.ConfigWindowsMoveFromTitleBarOnly && (!(window->Flags & ImGuiWindowFlags_NoTitleBar) || window->DockNodeAsHost))
|
||||||
size_for_clamping.y = window->TitleBarHeight();
|
size_for_clamping.y = ImGui::GetFrameHeight(); // Not using window->TitleBarHeight() as DockNodeAsHost will report 0.0f here.
|
||||||
window->Pos = ImClamp(window->Pos, visibility_rect.Min - size_for_clamping, visibility_rect.Max);
|
window->Pos = ImClamp(window->Pos, visibility_rect.Min - size_for_clamping, visibility_rect.Max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user