WeaveBrushToolAction
Paint freeform strokes on the canvas
Overview
The WeaveBrushToolAction class that enables users to draw freeform strokes on the canvas using a brush tool. It lets users click and drag across the canvas to create a smooth, continuous path—perfect for sketching, annotating, or freehand drawing within a collaborative environment.
Each stroke is recorded as a WeaveLineNode, synchronized across all connected users in real time.
The class extends the WeaveAction class.
Name
This action name property value is brushTool.
Type
This node nodeType property value is stroke.
Import
import { WeaveBrushToolAction } from "@inditextech/weave-sdk";Instantiation
new WeaveBrushToolAction(params?: WeaveBrushToolActionParams);TypeScript types
type WeaveBrushToolActionProperties = {
interpolationSteps: number; // Number of steps for interpolation
};
type WeaveBrushToolActionParams = {
config: Partial<WeaveBrushToolActionProperties>;
};Parameters
For WeaveBrushToolActionParams:
| Prop | Type | Default |
|---|---|---|
config | Partial<WeaveBrushToolActionParams> | - |
For WeaveBrushToolActionParams:
| Prop | Type | Default |
|---|---|---|
interpolationSteps? | number | 10 |
Default values
const BRUSH_TOOL_DEFAULT_CONFIG = {
interpolationSteps: 10,
};