Skip to content

Commit 95b3a3e

Browse files
[CP] Constrain _RenderScaledInlineWidget child size in computeDryLayout #131765 (#132096)
CP request: flutter/flutter#132095
1 parent 85127f4 commit 95b3a3e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/flutter/lib/src/widgets/widget_span.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class _RenderScaledInlineWidget extends RenderBox with RenderObjectWithChildMixi
362362
Size computeDryLayout(BoxConstraints constraints) {
363363
assert(!constraints.hasBoundedHeight);
364364
final Size unscaledSize = child?.computeDryLayout(BoxConstraints(maxWidth: constraints.maxWidth / scale)) ?? Size.zero;
365-
return unscaledSize * scale;
365+
return constraints.constrain(unscaledSize * scale);
366366
}
367367

368368
@override

packages/flutter/test/widgets/text_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ void main() {
273273
textDirection: TextDirection.ltr,
274274
child: Center(
275275
child: SizedBox(
276-
width: 100.3,
277-
child: Text.rich(WidgetSpan(child: Row()), textScaleFactor: 0.3),
276+
width: 502.5454545454545,
277+
child: Text.rich(WidgetSpan(child: Row()), textScaleFactor: 0.95),
278278
),
279279
),
280280
),

0 commit comments

Comments
 (0)