clamp method

Brush2DExtent clamp(
  1. Rect bounds
)

Clamps the extent to the given bounds.

Implementation

Brush2DExtent clamp(Rect bounds) {
  return Brush2DExtent(
    x.clamp(bounds.left, bounds.right),
    y.clamp(bounds.top, bounds.bottom),
  );
}