code cleanup

This commit is contained in:
Ryan Di
2025-06-27 20:33:57 +10:00
parent 1068153b25
commit abdacf8239
2 changed files with 5 additions and 7 deletions

View File

@ -455,7 +455,7 @@ export const newFreeDrawElement = (
simulatePressure: opts.simulatePressure,
lastCommittedPoint: null,
drawingConfigs: opts.drawingConfigs || {
pressureSensitivity: 1,
fixedStrokeWidth: true,
streamline: 0.25,
simplify: 0.1,
},

View File

@ -712,14 +712,12 @@ export const actionChangePressureSensitivity = register({
const selectedElements = app.scene.getSelectedElements(app.state);
const freedraws = selectedElements.filter(isFreeDrawElement);
const commonFixedStrokeWidth =
freedraws.length > 0
? freedraws.every((e) => e.drawingConfigs?.fixedStrokeWidth)
: null;
const currentValue =
freedraws.length > 0
? freedraws.every((e) => e.drawingConfigs?.fixedStrokeWidth) || null
? reduceToCommonValue(
freedraws,
(element) => element.drawingConfigs?.fixedStrokeWidth,
) ?? null
: appState.currentItemFixedStrokeWidth;
return (