goToPoint method

  1. @override
void goToPoint(
  1. double x,
  2. double y
)
override

Moves the center of the viewport to the specific x and y world coordinates.

Implementation

@override
void goToPoint(double x, double y) {
  if (!mounted) return;
  final canvasSize = context.size;
  if (canvasSize == null) return;
  setState(() {
    currentOrigin = Offset(
      canvasSize.width / 2 - x * currentScale,
      canvasSize.height / 2 + y * currentScale,
    );
  });
}