goToPoint method
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,
);
});
}