applyPaintTransform method

  1. @override
void applyPaintTransform(
  1. covariant RenderBox child,
  2. Matrix4 transform
)
override

Multiply the transform from the parent's coordinate system to this box's coordinate system into the given transform.

This function is used to convert coordinate systems between boxes. Subclasses that apply transforms during painting should override this function to factor those transforms into the calculation.

The RenderBox implementation takes care of adjusting the matrix for the position of the given child as determined during layout and stored on the child's parentData in the BoxParentData.offset field.

Implementation

@override
void applyPaintTransform(RenderBox child, Matrix4 transform) {
  final FlowParentData childParentData = child.parentData! as FlowParentData;
  if (childParentData._transform != null) {
    transform.multiply(childParentData._transform!);
  }
  super.applyPaintTransform(child, transform);
}