mirror of
https://github.com/excalidraw/excalidraw
synced 2025-07-25 13:58:22 +08:00
code cleanup
This commit is contained in:
@ -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,
|
||||
},
|
||||
|
@ -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 (
|
||||
|
Reference in New Issue
Block a user