scaleFromCenter method

Bounds scaleFromCenter(
  1. double factor
)

Scales the bounds around a center point.

Implementation

Bounds scaleFromCenter(double factor) {
  final cx = centerX;
  final cy = centerY;
  final newWidth = width * factor;
  final newHeight = height * factor;
  return Bounds(
    x: cx - newWidth / 2,
    y: cy - newHeight / 2,
    width: newWidth,
    height: newHeight,
  );
}