usePanZoom()
function usePanZoom(__namedParameters): {
actualSize: () => void;
dragging: boolean;
fit: () => void;
fitting: boolean;
scale: number;
transform: string;
zoomIn: () => void;
zoomOut: () => void;
};
Maintain bounded pan/zoom state for centered content, composing size observation and gesture handling. Apply transform to content with a centered transform origin inside a viewport using touch-action: none and overflow: hidden.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | UsePanZoomOptions |
Returns
{
actualSize: () => void;
dragging: boolean;
fit: () => void;
fitting: boolean;
scale: number;
transform: string;
zoomIn: () => void;
zoomOut: () => void;
}
| Name | Type | Default value |
|---|---|---|
actualSize() | () => void | - |
dragging | boolean | - |
fit() | () => void | - |
fitting | boolean | view.fitting |
scale | number | view.scale |
transform | string | - |
zoomIn() | () => void | - |
zoomOut() | () => void | - |