fittedPathMetricsFor function

FittedPathMetrics fittedPathMetricsFor(
  1. Path path
)

Implementation

FittedPathMetrics fittedPathMetricsFor(ui.Path path) {
  final bounds = path.getBounds();
  final maxDim = math.max(bounds.width, bounds.height);
  return FittedPathMetrics(
    bounds: bounds,
    maxDimension: maxDim,
    centerX: bounds.left + bounds.width * 0.5,
    centerY: bounds.top + bounds.height * 0.5,
  );
}