bounds property

Rect get bounds

Implementation

Rect get bounds {

  if (_bounds != null) return _bounds!;

  final layouts = computePies(
    points,
    dx,
    padAngle,
    thickness,
    borderRadius ?? 0.0,
    null
  );

  if (layouts.isEmpty) return _bounds = Rect.fromLTRB(0, 0, 1, 1);
  if (layouts.length == 1) return _bounds = layouts.first.toPath().getBounds();

  for (var layout in layouts) {
    if (_bounds == null) {
      _bounds = layout.toPath().getBounds();
    } else {
      _bounds = _bounds!.expandToInclude(layout.toPath().getBounds());
    }
  }

  return _bounds!;
}