containsPoint method

bool containsPoint(
  1. Offset point, {
  2. double portSize = 11.0,
})

Checks if a point is within the node's rectangular bounds.

This method tests if a given point in graph coordinates falls within the node's bounding rectangle.

For shaped nodes, hit testing is handled by the NodeShapePainter's hitTest method.

Parameters:

  • point - The point to test in graph coordinates
  • portSize - The size of ports (for compatibility, currently unused)

Returns true if the point is inside the node bounds, false otherwise.

Implementation

bool containsPoint(Offset point, {double portSize = 11.0}) {
  // Check if point is within the actual node bounds (not including port padding)
  return Rect.fromLTWH(
    position.value.dx,
    position.value.dy,
    size.value.width,
    size.value.height,
  ).contains(point);
}