renderTransform property

  1. @visibleForTesting
Float64List get renderTransform

This node's render transform. Equivalent to localTransform, except that it's stored in a Canvas-friendly typed_data structure for performance reasons.

The returned float list is owned by this node and should not be retained.

Implementation

@visibleForTesting
Float64List get renderTransform {
  final transform = _lastRenderTransform;
  final cosA = math.cos(angle);
  final sinA = math.sin(angle);

  transform
    ..[0] = cosA * scale.x
    ..[1] = sinA * scale.x
    ..[4] = -sinA * scale.y
    ..[5] = cosA * scale.y
    ..[12] = position.x
    ..[13] = position.y;

  return transform;
}