applyPaintTransform method Null safety
- covariant RenderObject child,
- 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(RenderObject child, Matrix4 transform) {
// Hit test logic relies on this always providing an invertible matrix.
assert(child != null);
final Offset offset = paintOffsetOf(child as RenderSliver);
transform.translate(offset.dx, offset.dy);
}