inBounds method

bool inBounds(
  1. VectorDefinition first,
  2. VectorDefinition last
)

Implementation

bool inBounds(VectorDefinition first, VectorDefinition last) {
  final minX = min(first.x, last.x);
  final maxX = max(first.x, last.x);
  final minY = min(first.y, last.y);
  final maxY = max(first.y, last.y);
  return x >= minX && x <= maxX && y >= minY && y <= maxY;
}