coerceAtMost method

Size coerceAtMost(
  1. Size maximum
)

Ensures that this Size is not larger than the specified maximum in any axis.

Implementation

Size coerceAtMost(Size maximum) =>
    Size(math.min(width, maximum.width), math.min(height, maximum.height));