roundToZero method

Vector2 roundToZero()

Implementation

Vector2 roundToZero() {
  x = (x < 0) ? Math.ceil(x).toDouble() : Math.floor(x).toDouble();
  y = (y < 0) ? Math.ceil(y).toDouble() : Math.floor(y).toDouble();

  return this;
}