selectNodesByArea method

void selectNodesByArea({
  1. bool holdSelection = false,
})

This method is used to select nodes that are contained within the selection area.

This method is used in conjunction with the setSelectionArea method to select nodes that are contained within the selection area. The method queries the spatial hash grid to find nodes that are within the selection area and then selects them.

See selectNodesById for more information.

Implementation

void selectNodesByArea({bool holdSelection = false}) async {
  final containedNodes = spatialHashGrid.queryArea(selectionArea);
  selectNodesById(containedNodes, holdSelection: holdSelection);
  selectionArea = Rect.zero;
}