feat: Add 'Fine' stroke width option for freehand tool

This commit is contained in:
nGrave 2025-04-20 00:46:11 +08:00
parent b5d60973b7
commit 1c0c6adbf3
4 changed files with 31 additions and 2 deletions

View file

@ -1033,10 +1033,18 @@ export function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) {
? element.points.map(([x, y], i) => [x, y, element.pressures[i]])
: [[0, 0, 0.5]];
let size;
if (element.strokeWidth === 0.5) {
size = 1.5;
} else {
// existin stroke widths
size = element.strokeWidth * 4.25;
}
// Consider changing the options for simulated pressure vs real pressure
const options: StrokeOptions = {
simulatePressure: element.simulatePressure,
size: element.strokeWidth * 4.25,
size: size,
thinning: 0.6,
smoothing: 0.5,
streamline: 0.5,