Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Piinks committed Jan 22, 2024
1 parent f4c7799 commit 243dcd8
Show file tree
Hide file tree
Showing 2 changed files with 503 additions and 498 deletions.
35 changes: 17 additions & 18 deletions packages/two_dimensional_scrollables/lib/src/table_view/table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -861,27 +861,27 @@ class RenderTableViewport extends RenderTwoDimensionalViewport {
)!;

Rect getColumnRect(bool consumePadding) {
final double leadingOffsetCorrection =
final ({double leading, double trailing}) offsetCorrection =
axisDirectionIsReversed(verticalAxisDirection)
? leadingCell.size.height
: 0.0;
final double trailingOffsetCorrection =
axisDirectionIsReversed(verticalAxisDirection)
? trailingCell.size.height
: 0.0;
? (
leading: leadingCell.size.height,
trailing: trailingCell.size.height,
)
: (leading: 0.0, trailing: 0.0);

return Rect.fromPoints(
parentDataOf(leadingCell).paintOffset! +
offset -
Offset(
consumePadding ? columnSpan.padding.leading : 0.0,
rowSpan.padding.leading - leadingOffsetCorrection,
rowSpan.padding.leading - offsetCorrection.leading,
),
parentDataOf(trailingCell).paintOffset! +
offset +
Offset(trailingCell.size.width, trailingCell.size.height) +
Offset(
consumePadding ? columnSpan.padding.trailing : 0.0,
rowSpan.padding.trailing - trailingOffsetCorrection,
rowSpan.padding.trailing - offsetCorrection.trailing,
),
);
}
Expand Down Expand Up @@ -920,26 +920,25 @@ class RenderTableViewport extends RenderTwoDimensionalViewport {
)!;

Rect getRowRect(bool consumePadding) {
final double leadingOffsetCorrection =
axisDirectionIsReversed(horizontalAxisDirection)
? leadingCell.size.height
: 0.0;
final double trailingOffsetCorrection =
final ({double leading, double trailing}) offsetCorrection =
axisDirectionIsReversed(horizontalAxisDirection)
? trailingCell.size.height
: 0.0;
? (
leading: leadingCell.size.width,
trailing: trailingCell.size.width,
)
: (leading: 0.0, trailing: 0.0);
return Rect.fromPoints(
parentDataOf(leadingCell).paintOffset! +
offset -
Offset(
columnSpan.padding.leading - leadingOffsetCorrection,
columnSpan.padding.leading - offsetCorrection.leading,
consumePadding ? rowSpan.padding.leading : 0.0,
),
parentDataOf(trailingCell).paintOffset! +
offset +
Offset(trailingCell.size.width, trailingCell.size.height) +
Offset(
columnSpan.padding.leading - trailingOffsetCorrection,
columnSpan.padding.leading - offsetCorrection.trailing,
consumePadding ? rowSpan.padding.trailing : 0.0,
),
);
Expand Down
Loading

0 comments on commit 243dcd8

Please sign in to comment.