localBounds property

  1. @override
Rect get localBounds
override

Axis-aligned bounds in local coordinates.

Implementation

@override
Rect get localBounds {
  buildLocalPath(copy: false);
  final bounds = _cachedLocalPathBounds;
  if (bounds == null) return Rect.zero;
  if (!_isFiniteRect(bounds)) return Rect.zero;
  var rect = bounds;
  final baseStrokeWidth = clampNonNegativeFinite(strokeWidth);
  if (strokeColor != null && baseStrokeWidth > 0) {
    rect = rect.inflate(baseStrokeWidth / 2);
  }
  return rect;
}