PinchEvent.fromFingers constructor
PinchEvent.fromFingers(
- FingerPoint f1,
- FingerPoint f2
Implementation
factory PinchEvent.fromFingers(FingerPoint f1, FingerPoint f2) {
final Vector2 initialPosition = Vector2(
min(f1.initialPosition.x, f2.initialPosition.x),
min(f1.initialPosition.y, f2.initialPosition.y),
);
final Vector2 position = Vector2(
min(f1.position.x, f2.position.x),
min(f1.position.y, f2.position.y),
);
return PinchEvent(
initalAngle: f1.initialPosition.angleTo(f2.initialPosition),
initalCenter: initialPosition,
initalDistance: f1.initialPosition.distanceTo(f2.initialPosition),
angle: f1.position.angleTo(f2.position),
center: position,
distance: f1.position.distanceTo(f2.position),
finger1: f1,
finger2: f2,
);
}