Overview
The WeaveFitToSelectionToolAction class that automatically zooms and pans the canvas to fit the currently selected nodes within the visible viewport. It helps users focus on specific elements of their work quickly, especially in large or complex canvases.
This action is the “fit to selection” counterpart of the broader WeaveFitToScreenToolAction, offering precise control and workflow efficiency.
The class extends the WeaveAction class.
TypeScript types
type WeaveFitToScreenToolActionParams = {
previousAction: string;
smartZoom?: boolean;
};
Trigger function params
trigger(cancelAction: () => void, params?: WeaveFitToSelectionToolActionParams): void;
For WeaveFitToSelectionToolActionParams:
| Property | Type | Required | Description |
|---|---|---|---|
|
|
Required |
The action to trigger after the fit-to-selection action is completed. |
|
|
If true, when fit-zooming we will only tri to zoom if nodes bounding box is overflowing stage bounding box, if not, we just center the stage on the nodes selected. |