getBounds method

  1. @override
GRect? getBounds(
  1. GDisplayObject? targetSpace, [
  2. GRect? out
])
override

Calculates the bounds of the shape in the coordinate system of the target object.

Implementation

@override
GRect? getBounds(GDisplayObject? targetSpace, [GRect? out]) {
  final matrix = _sHelperMatrix;
  matrix.identity();
  getTransformationMatrix(targetSpace, matrix);
  if (_isValid) {
    var r = _data!.size;
    out = MatrixUtils.getTransformedBoundsRect(
      matrix,
      r,
      out,
    );
  } else {
    matrix.transformCoords(0, 0, _sHelperPoint);
    out!.setTo(_sHelperPoint.x, _sHelperPoint.y, 0, 0);
  }
  return out;
}