updateChildPaintData method

void updateChildPaintData(
  1. RenderBox child
)

Called after layoutChildSequence to compute the TwoDimensionalViewportParentData.paintOffset and TwoDimensionalViewportParentData._paintExtent of the child.

Implementation

void updateChildPaintData(RenderBox child) {
  final TwoDimensionalViewportParentData childParentData = parentDataOf(child);
  assert(
    childParentData.layoutOffset != null,
    'The child with ChildVicinity(xIndex: ${childParentData.vicinity.xIndex}, '
    'yIndex: ${childParentData.vicinity.yIndex}) was not provided a '
    'layoutOffset. This should be set during layoutChildSequence, '
    'representing the position of the child.'
  );
  assert(child.hasSize); // Child must have been laid out by now.

  // Set paintExtent (and visibility)
  childParentData._paintExtent = computeChildPaintExtent(
    childParentData.layoutOffset!,
    child.size,
  );
  // Set paintOffset
  childParentData.paintOffset = computeAbsolutePaintOffsetFor(
    child,
    layoutOffset: childParentData.layoutOffset!,
  );
  // If the child is partially visible, or not visible at all, there is
  // visual overflow.
  _hasVisualOverflow = _hasVisualOverflow
    || childParentData.layoutOffset != childParentData._paintExtent
    || !childParentData.isVisible;
}