@@ -584,10 +584,8 @@ class RenderTableViewport extends RenderTwoDimensionalViewport {
584584 // Intersect with the section clip rect for this cell to prevent
585585 // scrollable cells from stealing hits inside the trailing pinned area.
586586 // This mirrors the pushClipRect applied to each section during painting.
587- final Rect clippedCellRect = cellRect.intersect (
588- _sectionClipRectFor (cellParentData.tableVicinity),
589- );
590- if (clippedCellRect.contains (position)) {
587+ if (cellRect.contains (position) &&
588+ _sectionClipRectFor (cellParentData.tableVicinity).contains (position)) {
591589 result.addWithPaintOffset (
592590 offset: cellParentData.paintOffset,
593591 position: position,
@@ -632,13 +630,14 @@ class RenderTableViewport extends RenderTwoDimensionalViewport {
632630 Rect _sectionClipRectFor (TableVicinity vicinity) {
633631 final bool reversedH = axisDirectionIsReversed (horizontalAxisDirection);
634632 final bool reversedV = axisDirectionIsReversed (verticalAxisDirection);
633+ final Size viewportSize = viewportDimension;
635634
636635 final double colLeft, colRight;
637636 if (vicinity.column < delegate.pinnedColumnCount) {
638637 // Leading pinned column — visually on the right when axis is reversed.
639638 if (reversedH) {
640- colLeft = viewportDimension .width - _leadingPinnedColumnsExtent;
641- colRight = viewportDimension .width;
639+ colLeft = viewportSize .width - _leadingPinnedColumnsExtent;
640+ colRight = viewportSize .width;
642641 } else {
643642 colLeft = 0.0 ;
644643 colRight = _leadingPinnedColumnsExtent;
@@ -650,26 +649,26 @@ class RenderTableViewport extends RenderTwoDimensionalViewport {
650649 colLeft = 0.0 ;
651650 colRight = _trailingPinnedColumnsExtent;
652651 } else {
653- colLeft = viewportDimension .width - _trailingPinnedColumnsExtent;
654- colRight = viewportDimension .width;
652+ colLeft = viewportSize .width - _trailingPinnedColumnsExtent;
653+ colRight = viewportSize .width;
655654 }
656655 } else {
657656 // Non-pinned column.
658657 if (reversedH) {
659658 colLeft = _trailingPinnedColumnsExtent;
660- colRight = viewportDimension .width - _leadingPinnedColumnsExtent;
659+ colRight = viewportSize .width - _leadingPinnedColumnsExtent;
661660 } else {
662661 colLeft = _leadingPinnedColumnsExtent;
663- colRight = viewportDimension .width - _trailingPinnedColumnsExtent;
662+ colRight = viewportSize .width - _trailingPinnedColumnsExtent;
664663 }
665664 }
666665
667666 final double rowTop, rowBottom;
668667 if (vicinity.row < delegate.pinnedRowCount) {
669668 // Leading pinned row — visually on the bottom when axis is reversed.
670669 if (reversedV) {
671- rowTop = viewportDimension .height - _leadingPinnedRowsExtent;
672- rowBottom = viewportDimension .height;
670+ rowTop = viewportSize .height - _leadingPinnedRowsExtent;
671+ rowBottom = viewportSize .height;
673672 } else {
674673 rowTop = 0.0 ;
675674 rowBottom = _leadingPinnedRowsExtent;
@@ -681,17 +680,17 @@ class RenderTableViewport extends RenderTwoDimensionalViewport {
681680 rowTop = 0.0 ;
682681 rowBottom = _trailingPinnedRowsExtent;
683682 } else {
684- rowTop = viewportDimension .height - _trailingPinnedRowsExtent;
685- rowBottom = viewportDimension .height;
683+ rowTop = viewportSize .height - _trailingPinnedRowsExtent;
684+ rowBottom = viewportSize .height;
686685 }
687686 } else {
688687 // Non-pinned row.
689688 if (reversedV) {
690689 rowTop = _trailingPinnedRowsExtent;
691- rowBottom = viewportDimension .height - _leadingPinnedRowsExtent;
690+ rowBottom = viewportSize .height - _leadingPinnedRowsExtent;
692691 } else {
693692 rowTop = _leadingPinnedRowsExtent;
694- rowBottom = viewportDimension .height - _trailingPinnedRowsExtent;
693+ rowBottom = viewportSize .height - _trailingPinnedRowsExtent;
695694 }
696695 }
697696
0 commit comments