onPanUpdate method

void onPanUpdate(
  1. Vector2 globalDelta
)

Global delta can be got from ScaleDetector.

@override
void onScaleUpdate(ScaleUpdateInfo info) {
  onPanUpdate(info.delta.global);
}

Do NOT use PanDetector along with ScaleDetector. Otherwise, Scale will not work on mobile. Because Scale events are based on Pan events in Flutter.

Implementation

void onPanUpdate(Vector2 globalDelta) {
  if (graph.hoverVertex != null) {
    algorithm.onDrag(graph.hoverVertex!, globalDelta, camera.viewfinder);
    graph.hoverVertex?.cpn?.onDrag(globalDelta);
  } else {
    camera.viewfinder.position -= globalDelta / camera.viewfinder.zoom;
  }
}