UI: Clamp fixed-size views to an AT_MOST spec

MeasureBySpec compared the spec against the view's previous measurement instead of
its fixed size, so a fixed-size view larger than the space offered wasn't clamped
unless an earlier measure happened to be larger.

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-10-24 12:35:55 +02:00
1 parent e30c8f7141
commit cfb0b1131b
1 file changed
+1 -1
+1 -1
View File
@@ -39,7 +39,7 @@ void MeasureBySpec(Size sz, float contentDim, MeasureSpec spec, float *measured)
*measured = std::max(spec.size, contentDim);
else
*measured = spec.size;
} else if (spec.type == EXACTLY || (spec.type == AT_MOST && *measured > spec.size)) {
} else if (spec.type == EXACTLY || (spec.type == AT_MOST && sz > spec.size)) {
*measured = spec.size;
} else {
*measured = sz;