UI: Don't let LinearLayout grow past an AT_MOST limit for weighted children

After measuring the weighted children, the measured size could grow beyond
the AT_MOST size the parent allowed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-11-08 23:38:06 +01:00
1 parent 9d5e39b33c
commit bac036a628
1 file changed
+2 -2
+2 -2
View File
@@ -721,7 +721,7 @@ void LinearLayout::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec v
}
if (horiz.type == AT_MOST && measuredWidth_ < horiz.size) {
measuredWidth_ += usedWidth;
measuredWidth_ = std::min(measuredWidth_ + usedWidth, horiz.size);
}
// Measure here in case maxOther moved (can happen due to word wrap.)
@@ -769,7 +769,7 @@ void LinearLayout::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec v
}
if (vert.type == AT_MOST && measuredHeight_ < vert.size) {
measuredHeight_ += usedHeight;
measuredHeight_ = std::min(measuredHeight_ + usedHeight, vert.size);
}
// Measure here in case maxOther moved (can happen due to word wrap.)