clampScalar method

  1. @override
Vector2 clampScalar(
  1. double minVal,
  2. double maxVal
)
override

Implementation

@override
Vector2 clampScalar(double minVal, double maxVal) {
  x = math.max(minVal, math.min(maxVal, x));
  y = math.max(minVal, math.min(maxVal, y));

  return this;
}