PinchGesture
The gesture pinch() makes, with a scale source multiplying what the follower was when it activated.
Usage
Apply a pinch's change in scale.
This type is used by 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>;Type declaration
export interface PinchGesture extends Gesture {
/** Its scale, multiplying what the follower was when it activated. */
readonly scale: GestureSource;
}Members 8
| Name | Type | Required | Description |
|---|---|---|---|
scalereadonly | GestureSource | Yes | Its scale, multiplying what the follower was when it activated. |
typereadonly | GestureType | Yes | — |
kindreadonly | GestureKind | Yes | — |
configreadonly | Readonly<Record<string, unknown>> | Yes | — |
callbacksreadonly | Readonly<Callbacks<never, never>> | Yes | — |
releasingreadonly | Animation<unknown> | No | How the motion values following it let go when it ends. |
release | (animation: Animation<unknown>) => PinchGesture | Yes | 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. |
activereadonly | GestureSource | Yes | 1 while it is active, 0 otherwise. |
release — method signatures
Signatures
(animation: Animation<unknown>): PinchGestureParameters
| Name | Type | Required | Description |
|---|---|---|---|
animation | Animation<unknown> | Yes | — |
Returns
PinchGesture
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.