clampDouble method

void clampDouble(
  1. double minX,
  2. double maxX,
  3. double minY,
  4. double maxY,
)

Clamps this vector so that it is within or equals to the bounds defined by (minX, maxX) and (minY, maxY).

Implementation

void clampDouble(double minX, double maxX, double minY, double maxY) {
  x = x.clamp(minX, maxX);
  y = y.clamp(minY, maxY);
}