onPinchUpdate method

  1. @override
void onPinchUpdate(
  1. PinchEvent event
)
override

Implementation

@override
void onPinchUpdate(PinchEvent event) {
  if (updateCameraByPinchGestureEnabled) {
    final scale = event.factorDistance;
    gameRef.camera.zoom = _initialZoom * scale;
    final diff = event.diffCenter;
    gameRef.camera.position =
        (_initialPosition - diff / (gameRef.camera.zoom));
  }

  super.onPinchUpdate(event);
}