Verwendung

Apply a pinch's change in scale.

Dieser Typ wird verwendet von 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>;

Typdeklaration

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

Mitglieder 8

NameTypErforderlichBeschreibung
scaleschreibgeschütztGestureSourceJaIts scale, multiplying what the follower was when it activated.
typeschreibgeschütztGestureTypeJa—
kindschreibgeschütztGestureKindJa—
configschreibgeschütztReadonly<Record<string, unknown>>Ja—
callbacksschreibgeschütztReadonly<Callbacks<never, never>>Ja—
releasingschreibgeschütztAnimation<unknown>NeinHow the motion values following it let go when it ends.
release(animation: Animation<unknown>) => PinchGestureJaThe 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ütztGestureSourceJa1 while it is active, 0 otherwise.
release — Methodensignaturen

Signaturen

ts
(animation: Animation<unknown>): PinchGesture

Parameter

NameTypErforderlichBeschreibung
animationAnimation<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.