Skip to content

Commit 706f39b

Browse files
Reverts "Implement computeDryBaseline for RenderWrap (#146260)" (#147692)
Reverts: flutter/flutter#146260 Initiated by: chingjun Reason for reverting: Broke internal tests. See b/338308016 Original PR Author: LongCatIsLooong Reviewed By: {goderbauer} This change reverts the following previous change:
1 parent 8025af0 commit 706f39b

File tree

3 files changed

+179
-238
lines changed

3 files changed

+179
-238
lines changed

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

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,7 @@ class RenderTable extends RenderBox {
806806
double? _baselineDistance;
807807
@override
808808
double? computeDistanceToActualBaseline(TextBaseline baseline) {
809-
// returns the baseline offset of the cell in the first row with
810-
// the lowest baseline, and uses `TableCellVerticalAlignment.baseline`.
809+
// returns the baseline of the first cell that has a baseline in the first row
811810
assert(!debugNeedsLayout);
812811
return _baselineDistance;
813812
}
@@ -1027,36 +1026,6 @@ class RenderTable extends RenderBox {
10271026
return Rect.fromLTRB(0.0, _rowTops[row], size.width, _rowTops[row + 1]);
10281027
}
10291028

1030-
@override
1031-
double? computeDryBaseline(covariant BoxConstraints constraints, TextBaseline baseline) {
1032-
if (rows * columns == 0) {
1033-
return null;
1034-
}
1035-
final List<double> widths = _computeColumnWidths(constraints);
1036-
double? baselineOffset;
1037-
for (int col = 0; col < columns; col += 1) {
1038-
final RenderBox? child = _children[col];
1039-
final BoxConstraints childConstraints = BoxConstraints.tightFor(width: widths[col]);
1040-
if (child == null) {
1041-
continue;
1042-
}
1043-
final TableCellParentData childParentData = child.parentData! as TableCellParentData;
1044-
final double? childBaseline = switch (childParentData.verticalAlignment ?? defaultVerticalAlignment) {
1045-
TableCellVerticalAlignment.baseline => child.getDryBaseline(childConstraints, baseline),
1046-
TableCellVerticalAlignment.baseline ||
1047-
TableCellVerticalAlignment.top ||
1048-
TableCellVerticalAlignment.middle ||
1049-
TableCellVerticalAlignment.bottom ||
1050-
TableCellVerticalAlignment.fill ||
1051-
TableCellVerticalAlignment.intrinsicHeight => null,
1052-
};
1053-
if (childBaseline != null && (baselineOffset == null || baselineOffset < childBaseline)) {
1054-
baselineOffset = childBaseline;
1055-
}
1056-
}
1057-
return baselineOffset;
1058-
}
1059-
10601029
@override
10611030
@protected
10621031
Size computeDryLayout(covariant BoxConstraints constraints) {

0 commit comments

Comments
 (0)