mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
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:
1 parent
9d5e39b33c
commit
bac036a628
1 file changed
+2
-2
@@ -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.)
|
||||
|
||||
Reference in new issue
Block a user