PinchGesture
The gesture pinch() makes, with a scale source multiplying what the follower was when it activated.
Utilização
Apply a pinch's change in scale.
Este tipo é usado por 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>;Declaração do tipo
export interface PinchGesture extends Gesture {
/** Its scale, multiplying what the follower was when it activated. */
readonly scale: GestureSource;
}Membros 8
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
scalesó de leitura | GestureSource | Sim | Its scale, multiplying what the follower was when it activated. |
typesó de leitura | GestureType | Sim | — |
kindsó de leitura | GestureKind | Sim | — |
configsó de leitura | Readonly<Record<string, unknown>> | Sim | — |
callbackssó de leitura | Readonly<Callbacks<never, never>> | Sim | — |
releasingsó de leitura | Animation<unknown> | Não | How the motion values following it let go when it ends. |
release | (animation: Animation<unknown>) => PinchGesture | Sim | 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. |
activesó de leitura | GestureSource | Sim | 1 while it is active, 0 otherwise. |
release — assinaturas de método
Assinaturas
(animation: Animation<unknown>): PinchGestureParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
animation | Animation<unknown> | Sim | — |
Devolve
PinchGesture
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.