Skip to content

Commit 473744d

Browse files
authored
Revert "fix wrap intrinsic height calculation (flutter#63420)" (flutter#64046)
This reverts commit 72619b8.
1 parent a51dc3d commit 473744d

File tree

2 files changed

+2
-52
lines changed

2 files changed

+2
-52
lines changed

packages/flutter/lib/src/rendering/wrap.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,7 @@ class RenderWrap extends RenderBox
409409
int childCount = 0;
410410
RenderBox child = firstChild;
411411
while (child != null) {
412-
// We want to make sure its width can only grow as big as the input width.
413-
final double childWidth = math.min(child.getMaxIntrinsicWidth(double.infinity), width);
412+
final double childWidth = child.getMaxIntrinsicWidth(double.infinity);
414413
final double childHeight = child.getMaxIntrinsicHeight(childWidth);
415414
// There must be at least one child before we move on to the next run.
416415
if (childCount > 0 && runWidth + childWidth + spacing > width) {
@@ -438,8 +437,7 @@ class RenderWrap extends RenderBox
438437
int childCount = 0;
439438
RenderBox child = firstChild;
440439
while (child != null) {
441-
// We want to make sure its height can only grow as big as the input height.
442-
final double childHeight = math.min(child.getMaxIntrinsicHeight(double.infinity), height);
440+
final double childHeight = child.getMaxIntrinsicHeight(double.infinity);
443441
final double childWidth = child.getMaxIntrinsicWidth(childHeight);
444442
// There must be at least one child before we move on to the next run.
445443
if (childCount > 0 && runHeight + childHeight + spacing > height) {

packages/flutter/test/rendering/wrap_test.dart

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -70,54 +70,6 @@ void main() {
7070
expect(renderWrap.computeMinIntrinsicHeight(79), 250);
7171
});
7272

73-
test('Compute intrinsic height test for width-in-height-out children', () {
74-
const double lineHeight = 15.0;
75-
final RenderWrap renderWrap = RenderWrap();
76-
renderWrap.add(
77-
RenderParagraph(
78-
const TextSpan(
79-
text: 'A very very very very very very very very long text',
80-
style: TextStyle(fontSize: lineHeight),
81-
),
82-
textDirection: TextDirection.ltr,
83-
),
84-
);
85-
86-
renderWrap.spacing = 0;
87-
renderWrap.runSpacing = 0;
88-
renderWrap.direction = Axis.horizontal;
89-
90-
expect(renderWrap.computeMaxIntrinsicHeight(double.infinity), lineHeight);
91-
expect(renderWrap.computeMaxIntrinsicHeight(600), 2 * lineHeight);
92-
expect(renderWrap.computeMaxIntrinsicHeight(300), 3 * lineHeight);
93-
});
94-
95-
test('Compute intrinsic width test for height-in-width-out children', () {
96-
const double lineHeight = 15.0;
97-
final RenderWrap renderWrap = RenderWrap();
98-
renderWrap.add(
99-
// Rotates a width-in-height-out render object to make it height-in-width-out.
100-
RenderRotatedBox(
101-
quarterTurns: 1,
102-
child: RenderParagraph(
103-
const TextSpan(
104-
text: 'A very very very very very very very very long text',
105-
style: TextStyle(fontSize: lineHeight),
106-
),
107-
textDirection: TextDirection.ltr,
108-
)
109-
),
110-
);
111-
112-
renderWrap.spacing = 0;
113-
renderWrap.runSpacing = 0;
114-
renderWrap.direction = Axis.vertical;
115-
116-
expect(renderWrap.computeMaxIntrinsicWidth(double.infinity), lineHeight);
117-
expect(renderWrap.computeMaxIntrinsicWidth(600), 2 * lineHeight);
118-
expect(renderWrap.computeMaxIntrinsicWidth(300), 3 * lineHeight);
119-
});
120-
12173
test('Compute intrinsic width test', () {
12274
final List<RenderBox> children = <RenderBox>[
12375
RenderConstrainedBox(

0 commit comments

Comments
 (0)