onScaleUpdate method

  1. @override
Future<void> onScaleUpdate(
  1. Vector2 focalPoint,
  2. Vector2 focalPointDelta,
  3. double horizontalScale,
  4. double verticalScale,
  5. double scale,
  6. int pointerCount,
  7. double rotation,
  8. Duration? sourceTimestamp,
)
override

Implementation

@override
Future<void> onScaleUpdate(
    Vector2 focalPoint,
    Vector2 focalPointDelta,
    double horizontalScale,
    double verticalScale,
    double scale,
    int pointerCount,
    double rotation,
    Duration? sourceTimestamp) async {
  if (pointerCount == 1) {
    _inputDeltas[InputType.SCALE1] =
        Vector3(focalPointDelta.x, focalPointDelta.y, 0);
  } else if (pointerCount == 2) {
    _inputDeltas[InputType.SCALE2] = Vector3(0, 0, scale);
  } else {
    throw UnimplementedError("Only pointerCount <= 2 supported");
  }
}