outOfBound function

bool outOfBound(
  1. double nextX,
  2. double nextY,
  3. double maxX,
  4. double maxY, {
  5. double overflow = 5,
})

Implementation

bool outOfBound(double nextX, double nextY, double maxX, double maxY,
    {double overflow = 5}) {
  if (nextX > maxX + overflow ||
      nextX < 0 - overflow ||
      nextY > maxY + overflow ||
      nextY < 0 - overflow)
    return true;
  else
    return false;
}