@@ -355,9 +355,9 @@ class GraphView extends StatefulWidget {
355355
356356class _GraphViewState extends State <GraphView > with TickerProviderStateMixin {
357357 late TransformationController _transformationController;
358- late final AnimationController _cameraController ;
358+ late final AnimationController _panController ;
359359 late final AnimationController _nodeController;
360- Animation <Matrix4 >? _cameraAnimation ;
360+ Animation <Matrix4 >? _panAnimation ;
361361
362362 @override
363363 void initState () {
@@ -366,7 +366,7 @@ class _GraphViewState extends State<GraphView> with TickerProviderStateMixin {
366366 _transformationController = widget.controller? .transformationController ??
367367 TransformationController ();
368368
369- _cameraController = AnimationController (
369+ _panController = AnimationController (
370370 vsync: this ,
371371 duration:
372372 widget.panAnimationDuration ?? const Duration (milliseconds: 600 ),
@@ -394,7 +394,7 @@ class _GraphViewState extends State<GraphView> with TickerProviderStateMixin {
394394 @override
395395 void dispose () {
396396 widget.controller? ._detach ();
397- _cameraController .dispose ();
397+ _panController .dispose ();
398398 _nodeController.dispose ();
399399 _transformationController.dispose ();
400400 super .dispose ();
@@ -489,22 +489,22 @@ class _GraphViewState extends State<GraphView> with TickerProviderStateMixin {
489489 }
490490
491491 void animateToMatrix (Matrix4 target) {
492- _cameraController .reset ();
493- _cameraAnimation = Matrix4Tween (
492+ _panController .reset ();
493+ _panAnimation = Matrix4Tween (
494494 begin: _transformationController.value, end: target)
495495 .animate (
496- CurvedAnimation (parent: _cameraController , curve: Curves .linear));
497- _cameraAnimation ! .addListener (_onCameraTick );
498- _cameraController .forward ();
499- }
500-
501- void _onCameraTick () {
502- if (_cameraAnimation == null ) return ;
503- _transformationController.value = _cameraAnimation ! .value;
504- if (! _cameraController .isAnimating) {
505- _cameraAnimation ! .removeListener (_onCameraTick );
506- _cameraAnimation = null ;
507- _cameraController .reset ();
496+ CurvedAnimation (parent: _panController , curve: Curves .linear));
497+ _panAnimation ! .addListener (_onPanTick );
498+ _panController .forward ();
499+ }
500+
501+ void _onPanTick () {
502+ if (_panAnimation == null ) return ;
503+ _transformationController.value = _panAnimation ! .value;
504+ if (! _panController .isAnimating) {
505+ _panAnimation ! .removeListener (_onPanTick );
506+ _panAnimation = null ;
507+ _panController .reset ();
508508 }
509509 }
510510
0 commit comments