@ue-too/board / index / PanToHandlerFunction
型エイリアス: PanToHandlerFunction()
PanToHandlerFunction = (
destination,camera,config) =>Point
定義: packages/board/src/camera/camera-rig/pan-handler.ts:160
Handler function type for absolute "pan to" camera operations.
パラメータ
destination
Point
Target camera position in world space
camera
Current camera instance
config
Pan behavior configuration
戻り値
Point
Transformed destination position (after applying restrictions and clamping)
Remarks
Pan-to handlers process absolute camera positioning requests. They form a pipeline that can apply restrictions, clamping, and other transformations to the target position.
Handler pipeline pattern:
- Each handler receives the current destination, camera state, and config
- Returns a potentially modified destination point
- Handlers can be chained using createHandlerChain
Common transformations:
- Axis restrictions (prevent movement on specific axes)
- Boundary clamping (keep position within bounds)
- Viewport constraints (ensure entire viewport stays in bounds)
例
typescript
const myPanToHandler: PanToHandlerFunction = (dest, camera, config) => {
// Custom logic: snap to grid
return {
x: Math.round(dest.x / 100) * 100,
y: Math.round(dest.y / 100) * 100
};
};参照
- createHandlerChain for composing handler pipelines
- createDefaultPanToHandler for the default implementation