Utilização

Apply a pinch's change in scale.

Este tipo é usado por pinch

tsx
// 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

ts
export interface PinchGesture extends Gesture {
  /** Its scale, multiplying what the follower was when it activated. */
  readonly scale: GestureSource;
}

Membros 8

NomeTipoObrigatórioDescrição
scalesó de leituraGestureSourceSimIts scale, multiplying what the follower was when it activated.
typesó de leituraGestureTypeSim—
kindsó de leituraGestureKindSim—
configsó de leituraReadonly<Record<string, unknown>>Sim—
callbackssó de leituraReadonly<Callbacks<never, never>>Sim—
releasingsó de leituraAnimation<unknown>NãoHow the motion values following it let go when it ends.
release(animation: Animation<unknown>) => PinchGestureSimThe 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 leituraGestureSourceSim1 while it is active, 0 otherwise.
release — assinaturas de método

Assinaturas

ts
(animation: Animation<unknown>): PinchGesture

Parâmetros

NomeTipoObrigatórioDescrição
animationAnimation<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.