Overview
The WeaveLineToolAction class that allows users to draw a precise, vector-based line by click-and-drag to define the line.
The line becomes a WeaveLineNode, synced in real time across all collaborators.
The class extends the WeaveAction class.
TypeScript types
type WeaveLineToolActionProperties = {
snapAngles: {
angles: number[]; // Angles for snapping in degrees
activateThreshold: number;
releaseThreshold: number;
};
};
type WeaveLineToolActionParams = {
config: Partial<WeaveLineToolActionProperties>;
};
Parameters
For WeaveLineToolActionParams:
| Property | Type | Required | Description |
|---|---|---|---|
|
|
Required |
Config parameters for the tool. |
For WeaveLineToolActionProperties:
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
|
|
Array of angles (in degrees) to snap the line to when shift is pressed. |
|
|
|
|
Activation threshold for the angle snapping utility. |
|
|
|
|
Release threshold for the angle snapping utility. |