INNER CODE UNIT · Dart

scaleX

nabil6391/graphview · lib/GraphView.dart:532

    final scaleX = (vp.width / bounds.width) * paddingFactor;
    final scaleY = (vp.height / bounds.height) * paddingFactor;
    final scale = min(scaleX, scaleY);

    final scaledWidth = bounds.width * scale;
    final scaledHeight = bounds.height * scale;

    final centerOffset = Offset(
        (vp.width - scaledWidth) * widget.horizontalBias - bounds.left * scale,
        (vp.height - scaledHeight) * widget.verticalBias - bounds.top * scale);

    final target = Matrix4.identity()
      ..translate(centerOffset.dx, centerOffset.dy)
      ..scale(scale);
    animateToMatrix(target);
  }

  void animateToMatrix(Matrix4 target) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…