findNodesInsideSelectionArea method

Set<VSNodeData> findNodesInsideSelectionArea(
  1. Offset start,
  2. Offset end
)

Returns a set of all nodes that fall into the are between the supplied start and end

Implementation

Set<VSNodeData> findNodesInsideSelectionArea(Offset start, Offset end) {
  final Set<VSNodeData> inside = {};
  for (final node in nodeManager.nodes.values) {
    final pos = node.widgetOffset;
    if (pos.dy > start.dy &&
        pos.dx > start.dx &&
        pos.dy < end.dy &&
        pos.dx < end.dx) {
      inside.add(node);
    }
  }
  return inside;
}