PinchGesture
The gesture pinch() makes, with a scale source multiplying what the follower was when it activated.
Verwendung
Apply a pinch's change in scale.
Dieser Typ wird verwendet von 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>;Typdeklaration
export interface PinchGesture extends Gesture {
/** Its scale, multiplying what the follower was when it activated. */
readonly scale: GestureSource;
}Mitglieder 8
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
scaleschreibgeschützt | GestureSource | Ja | Its scale, multiplying what the follower was when it activated. |
typeschreibgeschützt | GestureType | Ja | — |
kindschreibgeschützt | GestureKind | Ja | — |
configschreibgeschützt | Readonly<Record<string, unknown>> | Ja | — |
callbacksschreibgeschützt | Readonly<Callbacks<never, never>> | Ja | — |
releasingschreibgeschützt | Animation<unknown> | Nein | How the motion values following it let go when it ends. |
release | (animation: Animation<unknown>) => PinchGesture | Ja | 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. |
activeschreibgeschützt | GestureSource | Ja | 1 while it is active, 0 otherwise. |
release — Methodensignaturen
Signaturen
(animation: Animation<unknown>): PinchGestureParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
animation | Animation<unknown> | Ja | — |
Rückgabe
PinchGesture
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.