PinchGesture
The gesture pinch() makes, with a scale source multiplying what the follower was when it activated.
Utilisation
Apply a pinch's change in scale.
Ce type est utilisé par pinch
// Apply a pinch's change in scale.
import { Text, pinch, signal, type PinchChangeEvent } from 'kuito';
const fontSize = signal(17);
// Text size follows the pinch, between 12 and 34 points.
const resize = (event: PinchChangeEvent) => {
fontSize.value = Math.min(34, Math.max(12, fontSize.value * event.scaleChange));
};
<Text fontSize={fontSize.value} gestures={[pinch({ onChange: resize })]}>
Pinch to resize
</Text>;Déclaration du type
export interface PinchGesture extends Gesture {
/** Its scale, multiplying what the follower was when it activated. */
readonly scale: GestureSource;
}Membres 8
| Nom | Type | Requis | Description |
|---|---|---|---|
scalelecture seule | GestureSource | Oui | Its scale, multiplying what the follower was when it activated. |
typelecture seule | GestureType | Oui | — |
kindlecture seule | GestureKind | Oui | — |
configlecture seule | Readonly<Record<string, unknown>> | Oui | — |
callbackslecture seule | Readonly<Callbacks<never, never>> | Oui | — |
releasinglecture seule | Animation<unknown> | Non | How the motion values following it let go when it ends. |
release | (animation: Animation<unknown>) => PinchGesture | Oui | The same gesture, letting go with animation: each follower runs it with
the gesture's velocity, toward its own home (its first value) unless the
animation names a target. |
activelecture seule | GestureSource | Oui | 1 while it is active, 0 otherwise. |
release — signatures de méthode
Signatures
(animation: Animation<unknown>): PinchGestureParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
animation | Animation<unknown> | Oui | — |
Retourne
PinchGesture
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.