Child windows: look at the parent window's flags to decide whether to clamp child resizes. (#7440, #1710)
This commit is contained in:
@@ -57,6 +57,8 @@ Other changes:
|
|||||||
- Windows: Double-click to collapse may be disabled via key-ownership mechanism. (#7369)
|
- Windows: Double-click to collapse may be disabled via key-ownership mechanism. (#7369)
|
||||||
- Windows: Extend outer resize borders to the edges when there are no corner grips.
|
- Windows: Extend outer resize borders to the edges when there are no corner grips.
|
||||||
Essentially affects resizable child windows. (#7440, #1710) [@cfillion]
|
Essentially affects resizable child windows. (#7440, #1710) [@cfillion]
|
||||||
|
- Windows: Resizing logic for child windows evaluates whether per-axis clamping should be
|
||||||
|
applied based on parent scrollbars, not child scrollbars. (#7440, #1710) [@cfillion]
|
||||||
- Tables: Angled headers: fixed border hit box extending beyond when used within
|
- Tables: Angled headers: fixed border hit box extending beyond when used within
|
||||||
non-scrollable tables. (#7416) [@cfillion]
|
non-scrollable tables. (#7416) [@cfillion]
|
||||||
- Tables: Angled headers: fixed borders not moving back up after TableAngleHeadersRow()
|
- Tables: Angled headers: fixed borders not moving back up after TableAngleHeadersRow()
|
||||||
|
|||||||
@@ -6029,10 +6029,12 @@ static int ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& si
|
|||||||
border_target = ImClamp(border_target, clamp_min, clamp_max);
|
border_target = ImClamp(border_target, clamp_min, clamp_max);
|
||||||
if (flags & ImGuiWindowFlags_ChildWindow) // Clamp resizing of childs within parent
|
if (flags & ImGuiWindowFlags_ChildWindow) // Clamp resizing of childs within parent
|
||||||
{
|
{
|
||||||
if ((flags & (ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar)) == 0 || (flags & ImGuiWindowFlags_NoScrollbar))
|
ImGuiWindowFlags parent_flags = window->ParentWindow->Flags;
|
||||||
border_target.x = ImClamp(border_target.x, window->ParentWindow->InnerClipRect.Min.x, window->ParentWindow->InnerClipRect.Max.x);
|
const ImRect parent_rect = window->ParentWindow->InnerClipRect;
|
||||||
if (flags & ImGuiWindowFlags_NoScrollbar)
|
if ((parent_flags & (ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar)) == 0 || (parent_flags & ImGuiWindowFlags_NoScrollbar))
|
||||||
border_target.y = ImClamp(border_target.y, window->ParentWindow->InnerClipRect.Min.y, window->ParentWindow->InnerClipRect.Max.y);
|
border_target.x = ImClamp(border_target.x, parent_rect.Min.x, parent_rect.Max.x);
|
||||||
|
if (parent_flags & ImGuiWindowFlags_NoScrollbar)
|
||||||
|
border_target.y = ImClamp(border_target.y, parent_rect.Min.y, parent_rect.Max.y);
|
||||||
}
|
}
|
||||||
if (!ignore_resize)
|
if (!ignore_resize)
|
||||||
CalcResizePosSizeFromAnyCorner(window, border_target, ImMin(def.SegmentN1, def.SegmentN2), &pos_target, &size_target);
|
CalcResizePosSizeFromAnyCorner(window, border_target, ImMin(def.SegmentN1, def.SegmentN2), &pos_target, &size_target);
|
||||||
|
|||||||
Reference in New Issue
Block a user