renderTree method

  1. @mustCallSuper
  2. @override
void renderTree(
  1. Canvas canvas
)

Implementation

@mustCallSuper
@override
void renderTree(Canvas canvas) {
  final matrix = _transformMatrix;
  if (matrix.m14 != body.position.x ||
      matrix.m24 != body.position.y ||
      _lastAngle != angle) {
    matrix.setIdentity();
    matrix.translate(body.position.x, body.position.y);
    matrix.rotateZ(angle);
    _lastAngle = angle;
  }
  canvas.save();
  canvas.transform(matrix.storage);
  super.renderTree(canvas);
  canvas.restore();
}