pointInQuad function

bool pointInQuad(
  1. Offset p,
  2. List<Offset> q
)

Checks if point p is inside the quad defined by q (must be 4 points).

Implementation

@pragma('vm:prefer-inline')
bool pointInQuad(Offset p, List<Offset> q) {
  assert(q.length >= 4, 'Quad must have at least 4 points');
  return pointInTri(p, q[0], q[1], q[2]) || pointInTri(p, q[0], q[2], q[3]);
}