add stroke/pressure sensitivity to freedraw

This commit is contained in:
Ryan Di
2025-06-02 16:39:42 +10:00
parent 6c0ff7fc5c
commit 15dfe0cc7c
4 changed files with 9 additions and 2 deletions

View File

@@ -445,6 +445,7 @@ export const newFreeDrawElement = (
points?: ExcalidrawFreeDrawElement["points"];
simulatePressure: boolean;
pressures?: ExcalidrawFreeDrawElement["pressures"];
pressureSensitivity?: ExcalidrawFreeDrawElement["pressureSensitivity"];
} & ElementConstructorOpts,
): NonDeleted<ExcalidrawFreeDrawElement> => {
return {
@@ -453,6 +454,7 @@ export const newFreeDrawElement = (
pressures: opts.pressures || [],
simulatePressure: opts.simulatePressure,
lastCommittedPoint: null,
pressureSensitivity: opts.pressureSensitivity ?? 1,
};
};