moveSelection method

void moveSelection(
  1. Offset position
)

Implementation

void moveSelection(Offset position) {
  final delta = mouseDragStart != null
      ? toLocal(position) - toLocal(mouseDragStart!)
      : toLocal(position);
  for (final key in _selected) {
    final index = nodes.indexWhere((e) => e.key == key);
    if (index == -1) continue;
    final current = nodes[index];
    final origin = _selectedOrigins[key];
    current.update(offset: origin! + delta);
    if (_formatter != null) {
      _formatter!(current);
    }
  }
  notifyListeners();
}