INNER CODE UNIT · Dart

scaledNodeCenter

nabil6391/graphview · lib/GraphView.dart:507

    final scaledNodeCenter = offset * currentScale;
    final translation = center - scaledNodeCenter;

    final target = Matrix4.identity()
      ..translate(translation.dx, translation.dy)
      ..scale(currentScale);

    if (animated) {
      animateToMatrix(target);
    } else {
      _transformationController.value = target;
    }
  }

  void resetView() => animateToMatrix(Matrix4.identity());

  void zoomToFit() {
    var graph = widget.delegate.getVisibleGraphOnly();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…