mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-12 20:10:09 +02:00
code cleanup
This commit is contained in:
@@ -455,7 +455,7 @@ export const newFreeDrawElement = (
|
|||||||
simulatePressure: opts.simulatePressure,
|
simulatePressure: opts.simulatePressure,
|
||||||
lastCommittedPoint: null,
|
lastCommittedPoint: null,
|
||||||
drawingConfigs: opts.drawingConfigs || {
|
drawingConfigs: opts.drawingConfigs || {
|
||||||
pressureSensitivity: 1,
|
fixedStrokeWidth: true,
|
||||||
streamline: 0.25,
|
streamline: 0.25,
|
||||||
simplify: 0.1,
|
simplify: 0.1,
|
||||||
},
|
},
|
||||||
|
@@ -712,14 +712,12 @@ export const actionChangePressureSensitivity = register({
|
|||||||
const selectedElements = app.scene.getSelectedElements(app.state);
|
const selectedElements = app.scene.getSelectedElements(app.state);
|
||||||
const freedraws = selectedElements.filter(isFreeDrawElement);
|
const freedraws = selectedElements.filter(isFreeDrawElement);
|
||||||
|
|
||||||
const commonFixedStrokeWidth =
|
|
||||||
freedraws.length > 0
|
|
||||||
? freedraws.every((e) => e.drawingConfigs?.fixedStrokeWidth)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
const currentValue =
|
const currentValue =
|
||||||
freedraws.length > 0
|
freedraws.length > 0
|
||||||
? freedraws.every((e) => e.drawingConfigs?.fixedStrokeWidth) || null
|
? reduceToCommonValue(
|
||||||
|
freedraws,
|
||||||
|
(element) => element.drawingConfigs?.fixedStrokeWidth,
|
||||||
|
) ?? null
|
||||||
: appState.currentItemFixedStrokeWidth;
|
: appState.currentItemFixedStrokeWidth;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user