clamp method

void clamp(
  1. Vector2 min,
  2. Vector2 max
)

Clamp each entry n in this in the range [min[n]]-[max[n]].

Implementation

void clamp(Vector2 min, Vector2 max) {
  final Float64List minStorage = min._v2storage;
  final Float64List maxStorage = max._v2storage;
  _v2storage[1] = _v2storage[1].clamp(minStorage[1], maxStorage[1]);
  _v2storage[0] = _v2storage[0].clamp(minStorage[0], maxStorage[0]);
}