Compare commits

...

14 Commits

Author SHA1 Message Date
Ryan Di
b1f3cc50ee tweak stroke widths 2025-06-16 22:16:28 +10:00
Ryan Di
c72c47f0cd remove debug and provide value for stylus 2025-06-16 17:19:55 +10:00
Ryan Di
37b75263f8 put streamline & simplify into ele obj too 2025-06-13 18:12:56 +10:00
Ryan Di
c08840358b fix: funky shape corners for freedraw 2025-06-11 18:05:46 +10:00
Ryan Di
e99baaa6bb fix simulate pressure 2025-06-09 21:08:57 +10:00
Ryan Di
a8857f2849 debug sliders 2025-06-09 17:53:14 +10:00
Ryan Di
df1f9281b4 change slider to radio 2025-06-06 00:31:35 +10:00
Ryan Di
c210b7b092 improve params and real pressure 2025-06-05 23:00:40 +10:00
Ryan Di
660d21fe46 improve freedraw rendering 2025-06-05 16:53:22 +10:00
Ryan Di
c7780cb9cb snapshots 2025-06-02 17:33:44 +10:00
Ryan Di
4e265629c3 tweak stroke rendering 2025-06-02 17:00:19 +10:00
Ryan Di
1c611d6c4f add stroke sensivity action 2025-06-02 16:44:30 +10:00
Ryan Di
ab6af41d33 add current item stroke sensivity 2025-06-02 16:43:12 +10:00
Ryan Di
15dfe0cc7c add stroke/pressure sensitivity to freedraw 2025-06-02 16:39:42 +10:00
26 changed files with 715 additions and 165 deletions

View File

@ -385,8 +385,9 @@ export const ROUGHNESS = {
export const STROKE_WIDTH = {
thin: 1,
bold: 2,
extraBold: 4,
medium: 2,
bold: 4,
extraBold: 6,
} as const;
export const DEFAULT_ELEMENT_PROPS: {
@ -402,7 +403,7 @@ export const DEFAULT_ELEMENT_PROPS: {
strokeColor: COLOR_PALETTE.black,
backgroundColor: COLOR_PALETTE.transparent,
fillStyle: "solid",
strokeWidth: 2,
strokeWidth: STROKE_WIDTH.medium,
strokeStyle: "solid",
roughness: ROUGHNESS.artist,
opacity: 100,

View File

@ -3,8 +3,6 @@ import { simplify } from "points-on-curve";
import { pointFrom, pointDistance, type LocalPoint } from "@excalidraw/math";
import { ROUGHNESS, isTransparent, assertNever } from "@excalidraw/common";
import type { Mutable } from "@excalidraw/common/utility-types";
import type { EmbedsValidationStatus } from "@excalidraw/excalidraw/types";
import type { ElementShapes } from "@excalidraw/excalidraw/scene/types";
@ -514,15 +512,21 @@ export const _generateElementShape = (
generateFreeDrawShape(element);
if (isPathALoop(element.points)) {
// generate rough polygon to fill freedraw shape
const simplifiedPoints = simplify(
element.points as Mutable<LocalPoint[]>,
0.75,
);
shape = generator.curve(simplifiedPoints as [number, number][], {
...generateRoughOptions(element),
stroke: "none",
});
const points =
element.drawingConfigs === null
? simplify(element.points as LocalPoint[], 0.75)
: simplify(element.points as LocalPoint[], 1.5);
shape =
element.drawingConfigs === null
? generator.curve(points, {
...generateRoughOptions(element),
stroke: "none",
})
: generator.polygon(points, {
...generateRoughOptions(element),
stroke: "none",
});
} else {
shape = null;
}

View File

@ -0,0 +1,239 @@
import { LaserPointer, type Point } from "@excalidraw/laser-pointer";
import { clamp, round, type LocalPoint } from "@excalidraw/math";
import getStroke from "perfect-freehand";
import type { StrokeOptions } from "perfect-freehand";
import type { ExcalidrawFreeDrawElement } from "./types";
export const DRAWING_CONFIGS = {
default: {
streamline: 0.35,
simplify: 0.25,
},
// for optimal performance, we use a lower streamline and simplify
stylus: {
streamline: 0.1,
simplify: 0.1,
},
} as const;
/**
* Calculates simulated pressure based on velocity between consecutive points.
* Fast movement (large distances) -> lower pressure
* Slow movement (small distances) -> higher pressure
*/
const calculateVelocityBasedPressure = (
points: readonly LocalPoint[],
index: number,
pressureSensitivity: number | undefined,
maxDistance = 8, // Maximum expected distance for normalization
): number => {
// Handle pressure sensitivity
const sensitivity = pressureSensitivity ?? 1; // Default to 1 for backwards compatibility
// If sensitivity is 0, return constant pressure
if (sensitivity === 0) {
return 0.6;
}
// First point gets highest pressure
// This avoid "a dot followed by a line" effect, •== when first stroke is "slow"
if (index === 0) {
return 1;
}
const [x1, y1] = points[index - 1];
const [x2, y2] = points[index];
// Calculate distance between consecutive points
const distance = Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
// Normalize distance and invert for pressure (0 = fast/low pressure, 1 = slow/high pressure)
const normalizedDistance = Math.min(distance / maxDistance, 1);
const basePressure = Math.max(0.1, 1 - normalizedDistance * 0.7); // Range: 0.1 to 1.0
const constantPressure = 0.5;
const pressure =
constantPressure + (basePressure - constantPressure) * sensitivity;
return Math.max(0.1, Math.min(1.0, pressure));
};
export const getFreedrawStroke = (element: ExcalidrawFreeDrawElement) => {
// Compose points as [x, y, pressure]
let points: [number, number, number][];
if (element.simulatePressure) {
// Simulate pressure based on velocity between consecutive points
points = element.points.map(([x, y]: LocalPoint, i) => [
x,
y,
calculateVelocityBasedPressure(
element.points,
i,
element.drawingConfigs?.pressureSensitivity,
),
]);
} else {
const sensitivity = element.drawingConfigs?.pressureSensitivity ?? 1;
points = element.points.map(([x, y]: LocalPoint, i) => {
if (sensitivity === 0) {
return [x, y, 0.5];
}
const rawPressure = element.pressures?.[i] ?? 0.5;
const amplifiedPressure = Math.pow(rawPressure, 0.6);
const adjustedPressure = amplifiedPressure * sensitivity;
return [x, y, clamp(adjustedPressure, 0.1, 1.0)];
});
}
const streamline =
element.drawingConfigs?.streamline ?? DRAWING_CONFIGS.default.streamline;
const simplify =
element.drawingConfigs?.simplify ?? DRAWING_CONFIGS.default.simplify;
const laser = new LaserPointer({
size: element.strokeWidth,
streamline,
simplify,
sizeMapping: ({ pressure: t }) => {
if (element.drawingConfigs?.pressureSensitivity === 0) {
return 0.5;
}
if (element.simulatePressure) {
return 0.2 + t * 0.6;
}
return 0.2 + t * 0.8;
},
});
for (const pt of points) {
laser.addPoint(pt);
}
laser.close();
return laser.getStrokeOutline();
};
/**
* Generates an SVG path for a freedraw element using LaserPointer logic.
* Uses actual pressure data if available, otherwise simulates pressure based on velocity.
* No streamline, smoothing, or simulation is performed.
*/
export const getFreeDrawSvgPath = (
element: ExcalidrawFreeDrawElement,
): string => {
// legacy, for backwards compatibility
if (element.drawingConfigs === null) {
return _legacy_getFreeDrawSvgPath(element);
}
return getSvgPathFromStroke(getFreedrawStroke(element));
};
const roundPoint = (A: Point): string => {
return `${round(A[0], 4, "round")},${round(A[1], 4, "round")} `;
};
const average = (A: Point, B: Point): string => {
return `${round((A[0] + B[0]) / 2, 4, "round")},${round(
(A[1] + B[1]) / 2,
4,
"round",
)} `;
};
const getSvgPathFromStroke = (points: Point[]): string => {
const len = points.length;
if (len < 2) {
return "";
}
let a = points[0];
let b = points[1];
if (len === 2) {
return `M${roundPoint(a)}L${roundPoint(b)}`;
}
let result = "";
for (let i = 2, max = len - 1; i < max; i++) {
a = points[i];
b = points[i + 1];
result += average(a, b);
}
return `M${roundPoint(points[0])}Q${roundPoint(points[1])}${average(
points[1],
points[2],
)}${points.length > 3 ? "T" : ""}${result}L${roundPoint(points[len - 1])}`;
};
function _legacy_getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) {
// If input points are empty (should they ever be?) return a dot
const inputPoints = element.simulatePressure
? element.points
: element.points.length
? element.points.map(([x, y], i) => [x, y, element.pressures[i]])
: [[0, 0, 0.5]];
const sensitivity = element.drawingConfigs?.pressureSensitivity;
// Consider changing the options for simulated pressure vs real pressure
const options: StrokeOptions = {
simulatePressure: element.simulatePressure,
// if sensitivity is not set, times 4.25 for backwards compatibility
size: element.strokeWidth * (sensitivity !== null ? 1 : 4.25),
// if sensitivity is not set, set thinning to 0.6 for backwards compatibility
thinning: sensitivity !== undefined ? 0.5 * sensitivity : 0.6,
smoothing: 0.5,
streamline: 0.5,
easing: (t) => Math.sin((t * Math.PI) / 2), // https://easings.net/#easeOutSine
last: !!element.lastCommittedPoint, // LastCommittedPoint is added on pointerup
};
return _legacy_getSvgPathFromStroke(
getStroke(inputPoints as number[][], options),
);
}
const med = (A: number[], B: number[]) => {
return [(A[0] + B[0]) / 2, (A[1] + B[1]) / 2];
};
// Trim SVG path data so number are each two decimal points. This
// improves SVG exports, and prevents rendering errors on points
// with long decimals.
const TO_FIXED_PRECISION = /(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;
const _legacy_getSvgPathFromStroke = (points: number[][]): string => {
if (!points.length) {
return "";
}
const max = points.length - 1;
return points
.reduce(
(acc, point, i, arr) => {
if (i === max) {
acc.push(point, med(point, arr[0]), "L", arr[0], "Z");
} else {
acc.push(point, med(point, arr[i + 1]));
}
return acc;
},
["M", points[0], "Q"],
)
.join(" ")
.replace(TO_FIXED_PRECISION, "$1");
};

View File

@ -91,6 +91,7 @@ export * from "./embeddable";
export * from "./flowchart";
export * from "./fractionalIndex";
export * from "./frame";
export * from "./freedraw";
export * from "./groups";
export * from "./heading";
export * from "./image";

View File

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

View File

@ -1,5 +1,4 @@
import rough from "roughjs/bin/rough";
import { getStroke } from "perfect-freehand";
import { isRightAngleRads } from "@excalidraw/math";
@ -58,6 +57,8 @@ import { getCornerRadius } from "./shapes";
import { ShapeCache } from "./ShapeCache";
import { getFreeDrawSvgPath } from "./freedraw";
import type {
ExcalidrawElement,
ExcalidrawTextElement,
@ -70,7 +71,6 @@ import type {
ElementsMap,
} from "./types";
import type { StrokeOptions } from "perfect-freehand";
import type { RoughCanvas } from "roughjs/bin/canvas";
// using a stronger invert (100% vs our regular 93%) and saturate
@ -1032,57 +1032,3 @@ export function generateFreeDrawShape(element: ExcalidrawFreeDrawElement) {
export function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement) {
return pathsCache.get(element);
}
export function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) {
// If input points are empty (should they ever be?) return a dot
const inputPoints = element.simulatePressure
? element.points
: element.points.length
? element.points.map(([x, y], i) => [x, y, element.pressures[i]])
: [[0, 0, 0.5]];
// Consider changing the options for simulated pressure vs real pressure
const options: StrokeOptions = {
simulatePressure: element.simulatePressure,
size: element.strokeWidth * 4.25,
thinning: 0.6,
smoothing: 0.5,
streamline: 0.5,
easing: (t) => Math.sin((t * Math.PI) / 2), // https://easings.net/#easeOutSine
last: !!element.lastCommittedPoint, // LastCommittedPoint is added on pointerup
};
return getSvgPathFromStroke(getStroke(inputPoints as number[][], options));
}
function med(A: number[], B: number[]) {
return [(A[0] + B[0]) / 2, (A[1] + B[1]) / 2];
}
// Trim SVG path data so number are each two decimal points. This
// improves SVG exports, and prevents rendering errors on points
// with long decimals.
const TO_FIXED_PRECISION = /(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;
function getSvgPathFromStroke(points: number[][]): string {
if (!points.length) {
return "";
}
const max = points.length - 1;
return points
.reduce(
(acc, point, i, arr) => {
if (i === max) {
acc.push(point, med(point, arr[0]), "L", arr[0], "Z");
} else {
acc.push(point, med(point, arr[i + 1]));
}
return acc;
},
["M", points[0], "Q"],
)
.join(" ")
.replace(TO_FIXED_PRECISION, "$1");
}

View File

@ -379,6 +379,11 @@ export type ExcalidrawFreeDrawElement = _ExcalidrawElementBase &
pressures: readonly number[];
simulatePressure: boolean;
lastCommittedPoint: LocalPoint | null;
drawingConfigs: {
streamline?: number;
simplify?: number;
pressureSensitivity?: number;
} | null;
}>;
export type FileId = string & { _brand: "FileId" };

View File

@ -145,26 +145,27 @@ describe("element locking", () => {
queryByTestId(document.body, `strokeWidth-thin`),
).not.toBeChecked();
expect(
queryByTestId(document.body, `strokeWidth-bold`),
queryByTestId(document.body, `strokeWidth-medium`),
).not.toBeChecked();
expect(
queryByTestId(document.body, `strokeWidth-extraBold`),
queryByTestId(document.body, `strokeWidth-bold`),
).not.toBeChecked();
});
it("should show properties of different element types when selected", () => {
const rect = API.createElement({
type: "rectangle",
strokeWidth: STROKE_WIDTH.bold,
strokeWidth: STROKE_WIDTH.medium,
});
const text = API.createElement({
type: "text",
fontFamily: FONT_FAMILY["Comic Shanns"],
strokeWidth: undefined,
});
API.setElements([rect, text]);
API.setSelectedElements([rect, text]);
expect(queryByTestId(document.body, `strokeWidth-bold`)).toBeChecked();
expect(queryByTestId(document.body, `strokeWidth-medium`)).toBeChecked();
expect(queryByTestId(document.body, `font-family-code`)).toHaveClass(
"active",
);

View File

@ -47,6 +47,7 @@ import {
isArrowElement,
isBoundToContainer,
isElbowArrow,
isFreeDrawElement,
isLinearElement,
isLineElement,
isTextElement,
@ -127,6 +128,9 @@ import {
ArrowheadCrowfootIcon,
ArrowheadCrowfootOneIcon,
ArrowheadCrowfootOneOrManyIcon,
strokeWidthFixedIcon,
strokeWidthVariableIcon,
StrokeWidthMediumIcon,
} from "../components/icons";
import { Fonts } from "../fonts";
@ -506,6 +510,33 @@ export const actionChangeFillStyle = register({
},
});
const WIDTHS = [
{
value: STROKE_WIDTH.thin,
text: t("labels.thin"),
icon: StrokeWidthBaseIcon,
testId: "strokeWidth-thin",
},
{
value: STROKE_WIDTH.medium,
text: t("labels.medium"),
icon: StrokeWidthMediumIcon,
testId: "strokeWidth-medium",
},
{
value: STROKE_WIDTH.bold,
text: t("labels.bold"),
icon: StrokeWidthBoldIcon,
testId: "strokeWidth-bold",
},
{
value: STROKE_WIDTH.extraBold,
text: t("labels.extraBold"),
icon: StrokeWidthExtraBoldIcon,
testId: "strokeWidth-extraBold",
},
];
export const actionChangeStrokeWidth = register({
name: "changeStrokeWidth",
label: "labels.strokeWidth",
@ -527,26 +558,11 @@ export const actionChangeStrokeWidth = register({
<div className="buttonList">
<RadioSelection
group="stroke-width"
options={[
{
value: STROKE_WIDTH.thin,
text: t("labels.thin"),
icon: StrokeWidthBaseIcon,
testId: "strokeWidth-thin",
},
{
value: STROKE_WIDTH.bold,
text: t("labels.bold"),
icon: StrokeWidthBoldIcon,
testId: "strokeWidth-bold",
},
{
value: STROKE_WIDTH.extraBold,
text: t("labels.extraBold"),
icon: StrokeWidthExtraBoldIcon,
testId: "strokeWidth-extraBold",
},
]}
options={
appState.activeTool.type === "freedraw"
? WIDTHS
: WIDTHS.slice(0, 3)
}
value={getFormValue(
elements,
app,
@ -669,6 +685,66 @@ export const actionChangeStrokeStyle = register({
),
});
export const actionChangePressureSensitivity = register({
name: "changeStrokeType",
label: "labels.strokeType",
trackEvent: false,
perform: (elements, appState, value) => {
return {
elements,
appState: { ...appState, currentItemPressureSensitivity: value },
captureUpdate: CaptureUpdateAction.IMMEDIATELY,
};
},
PanelComponent: ({ app, appState, updateData }) => {
if (appState.activeTool.type !== "freedraw") {
return null;
}
const selectedElements = app.scene.getSelectedElements(app.state);
const firstElement = selectedElements.find(isFreeDrawElement);
const commonPressureSensitivity = selectedElements
.filter(isFreeDrawElement)
.reduce((acc, element) => {
const sensitivity = element.drawingConfigs?.pressureSensitivity ?? 1;
if (acc !== null && acc !== sensitivity) {
return null; // No common value
}
return sensitivity;
}, firstElement?.drawingConfigs?.pressureSensitivity ?? null);
const currentValue =
commonPressureSensitivity ?? appState.currentItemPressureSensitivity;
return (
<fieldset>
<legend>{t("labels.strokeType")}</legend>
<div className="buttonList">
<RadioSelection
group="pressure-sensitivity"
options={[
{
value: 0,
text: t("labels.strokeWidthFixed"),
icon: strokeWidthFixedIcon,
testId: "pressure-fixed",
},
{
value: 1,
text: t("labels.strokeWidthVariable"),
icon: strokeWidthVariableIcon,
testId: "pressure-variable",
},
]}
value={currentValue}
onChange={(value) => updateData(value)}
/>
</div>
</fieldset>
);
},
});
export const actionChangeOpacity = register({
name: "changeOpacity",
label: "labels.opacity",

View File

@ -13,6 +13,7 @@ export {
actionChangeStrokeWidth,
actionChangeFillStyle,
actionChangeSloppiness,
actionChangePressureSensitivity,
actionChangeOpacity,
actionChangeFontSize,
actionChangeFontFamily,

View File

@ -69,6 +69,7 @@ export type ActionName =
| "changeStrokeStyle"
| "changeArrowhead"
| "changeArrowType"
| "changeStrokeType"
| "changeOpacity"
| "changeFontSize"
| "toggleCanvasMenu"

View File

@ -33,6 +33,7 @@ export const getDefaultAppState = (): Omit<
currentItemFontFamily: DEFAULT_FONT_FAMILY,
currentItemFontSize: DEFAULT_FONT_SIZE,
currentItemOpacity: DEFAULT_ELEMENT_PROPS.opacity,
currentItemPressureSensitivity: 1,
currentItemRoughness: DEFAULT_ELEMENT_PROPS.roughness,
currentItemStartArrowhead: null,
currentItemStrokeColor: DEFAULT_ELEMENT_PROPS.strokeColor,
@ -163,6 +164,11 @@ const APP_STATE_STORAGE_CONF = (<
server: false,
},
currentItemOpacity: { browser: true, export: false, server: false },
currentItemPressureSensitivity: {
browser: true,
export: false,
server: false,
},
currentItemRoughness: { browser: true, export: false, server: false },
currentItemStartArrowhead: { browser: true, export: false, server: false },
currentItemStrokeColor: { browser: true, export: false, server: false },

View File

@ -169,8 +169,12 @@ export const SelectedShapeActions = ({
renderAction("changeStrokeWidth")}
{(appState.activeTool.type === "freedraw" ||
targetElements.some((element) => element.type === "freedraw")) &&
renderAction("changeStrokeShape")}
targetElements.some((element) => element.type === "freedraw")) && (
<>
{renderAction("changeStrokeShape")}
{renderAction("changeStrokeType")}
</>
)}
{(hasStrokeStyle(appState.activeTool.type) ||
targetElements.some((element) => hasStrokeStyle(element.type))) && (

View File

@ -104,7 +104,11 @@ import {
Emitter,
} from "@excalidraw/common";
import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element";
import {
DRAWING_CONFIGS,
getCommonBounds,
getElementAbsoluteCoords,
} from "@excalidraw/element";
import {
bindOrUnbindLinearElements,
@ -7573,7 +7577,7 @@ class App extends React.Component<AppProps, AppState> {
y: gridY,
});
const simulatePressure = event.pressure === 0.5;
const simulatePressure = event.pressure === 0.5 || event.pressure === 0;
const element = newFreeDrawElement({
type: elementType,
@ -7588,6 +7592,12 @@ class App extends React.Component<AppProps, AppState> {
opacity: this.state.currentItemOpacity,
roundness: null,
simulatePressure,
drawingConfigs: {
pressureSensitivity: this.state.currentItemPressureSensitivity,
...(event.pointerType === "pen"
? DRAWING_CONFIGS.stylus
: DRAWING_CONFIGS.default),
},
locked: false,
frameId: topLayerFrame ? topLayerFrame.id : null,
points: [pointFrom<LocalPoint>(0, 0)],

View File

@ -1136,7 +1136,7 @@ export const StrokeWidthBaseIcon = createIcon(
modifiedTablerIconProps,
);
export const StrokeWidthBoldIcon = createIcon(
export const StrokeWidthMediumIcon = createIcon(
<path
d="M5 10h10"
stroke="currentColor"
@ -1147,7 +1147,7 @@ export const StrokeWidthBoldIcon = createIcon(
modifiedTablerIconProps,
);
export const StrokeWidthExtraBoldIcon = createIcon(
export const StrokeWidthBoldIcon = createIcon(
<path
d="M5 10h10"
stroke="currentColor"
@ -1158,6 +1158,17 @@ export const StrokeWidthExtraBoldIcon = createIcon(
modifiedTablerIconProps,
);
export const StrokeWidthExtraBoldIcon = createIcon(
<path
d="M5 10h10"
stroke="currentColor"
strokeWidth="5"
strokeLinecap="round"
strokeLinejoin="round"
/>,
modifiedTablerIconProps,
);
export const StrokeStyleSolidIcon = React.memo(({ theme }: { theme: Theme }) =>
createIcon(
<path
@ -2269,3 +2280,71 @@ export const elementLinkIcon = createIcon(
</g>,
tablerIconProps,
);
export const strokeWidthFixedIcon = createIcon(
<g>
<path
d="M4 12 C 5 8, 6 8, 8 12"
fill="none"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8 12 C 9 16, 10 16, 12 12"
fill="none"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M12 12 C 14 8, 15 8, 16 12"
fill="none"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M16 12 C 17 16, 18 16, 19 12"
fill="none"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>,
tablerIconProps,
);
export const strokeWidthVariableIcon = createIcon(
<g>
<path
d="M4 12 C 5 8, 6 8, 8 12"
fill="none"
strokeWidth="3.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8 12 C 9 16, 10 16, 12 12"
fill="none"
strokeWidth="2.75"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M12 12 C 14 8, 15 8, 16 12"
fill="none"
strokeWidth="2.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M16 12 C 17 16, 18 16, 19 12"
fill="none"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>,
tablerIconProps,
);

View File

@ -302,6 +302,8 @@ const restoreElement = (
lastCommittedPoint: null,
simulatePressure: element.simulatePressure,
pressures: element.pressures,
// legacy, for backwards compatibility
drawingConfigs: element.drawingConfigs ?? null,
});
}
case "image":

View File

@ -248,7 +248,7 @@ export {
loadSceneOrLibraryFromBlob,
loadLibraryFromBlob,
} from "./data/blob";
export { getFreeDrawSvgPath } from "@excalidraw/element";
export { getFreeDrawSvgPath } from "@excalidraw/element/freedraw";
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
export { isLinearElement } from "@excalidraw/element";

View File

@ -32,6 +32,9 @@
"strokeStyle_dotted": "Dotted",
"sloppiness": "Sloppiness",
"opacity": "Opacity",
"strokeType": "Stroke Type",
"strokeWidthFixed": "Fixed width",
"strokeWidthVariable": "Variable width",
"textAlign": "Text align",
"edges": "Edges",
"sharp": "Sharp",

View File

@ -897,6 +897,7 @@ exports[`contextMenu element > right-clicking on a group should select whole gro
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1100,6 +1101,7 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1316,6 +1318,7 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1649,6 +1652,7 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1982,6 +1986,7 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2198,6 +2203,7 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2439,6 +2445,7 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2741,6 +2748,7 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -3113,12 +3121,13 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 60,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 2,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
"currentItemStrokeColor": "#e03131",
"currentItemStrokeStyle": "dotted",
"currentItemStrokeWidth": 2,
"currentItemStrokeWidth": 4,
"currentItemTextAlign": "left",
"cursorButton": "up",
"defaultSidebarDockedPreference": false,
@ -3232,11 +3241,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"seed": 449462985,
"strokeColor": "#e03131",
"strokeStyle": "dotted",
"strokeWidth": 2,
"strokeWidth": 4,
"type": "rectangle",
"updated": 1,
"version": 4,
"versionNonce": 941653321,
"versionNonce": 1402203177,
"width": 20,
"x": -10,
"y": 0,
@ -3263,14 +3272,14 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"roundness": {
"type": 3,
},
"seed": 289600103,
"seed": 1898319239,
"strokeColor": "#e03131",
"strokeStyle": "dotted",
"strokeWidth": 2,
"strokeWidth": 4,
"type": "rectangle",
"updated": 1,
"version": 9,
"versionNonce": 640725609,
"version": 10,
"versionNonce": 941653321,
"width": 20,
"x": 20,
"y": 30,
@ -3279,7 +3288,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
exports[`contextMenu element > selecting 'Paste styles' in context menu pastes styles > [end of test] number of elements 1`] = `2`;
exports[`contextMenu element > selecting 'Paste styles' in context menu pastes styles > [end of test] number of renders 1`] = `16`;
exports[`contextMenu element > selecting 'Paste styles' in context menu pastes styles > [end of test] number of renders 1`] = `17`;
exports[`contextMenu element > selecting 'Paste styles' in context menu pastes styles > [end of test] redo stack 1`] = `[]`;
@ -3460,6 +3469,29 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
},
"id": "id11",
},
{
"appState": AppStateDelta {
"delta": Delta {
"deleted": {},
"inserted": {},
},
},
"elements": {
"added": {},
"removed": {},
"updated": {
"id3": {
"deleted": {
"strokeWidth": 4,
},
"inserted": {
"strokeWidth": 2,
},
},
},
},
"id": "id13",
},
{
"appState": AppStateDelta {
"delta": Delta {
@ -3481,7 +3513,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
},
},
},
"id": "id13",
"id": "id15",
},
{
"appState": AppStateDelta {
@ -3504,7 +3536,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
},
},
},
"id": "id15",
"id": "id17",
},
{
"appState": AppStateDelta {
@ -3527,7 +3559,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
},
},
},
"id": "id17",
"id": "id19",
},
{
"appState": AppStateDelta {
@ -3556,6 +3588,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"roughness": 2,
"strokeColor": "#e03131",
"strokeStyle": "dotted",
"strokeWidth": 4,
},
"inserted": {
"backgroundColor": "transparent",
@ -3564,11 +3597,12 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"roughness": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
},
},
},
},
"id": "id19",
"id": "id21",
},
]
`;
@ -3596,6 +3630,7 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -3921,6 +3956,7 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -4246,6 +4282,7 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -5527,6 +5564,7 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -6748,6 +6786,7 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -7683,6 +7722,7 @@ exports[`contextMenu element > shows context menu for canvas > [end of test] app
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8683,6 +8723,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -9674,6 +9715,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,

View File

@ -23,6 +23,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -614,6 +615,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1123,6 +1125,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1491,6 +1494,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1860,6 +1864,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2127,6 +2132,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2564,6 +2570,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2863,6 +2870,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -3147,6 +3155,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -3441,6 +3450,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -3727,6 +3737,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -3962,6 +3973,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -4221,6 +4233,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -4494,6 +4507,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -4725,6 +4739,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -4956,6 +4971,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -5185,6 +5201,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -5414,6 +5431,7 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -5674,6 +5692,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -6007,6 +6026,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -6436,6 +6456,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -6816,6 +6837,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -7136,6 +7158,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -7437,6 +7460,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -7667,6 +7691,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8023,6 +8048,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8379,6 +8405,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8787,6 +8814,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8882,6 +8910,11 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"backgroundColor": "transparent",
"boundElements": null,
"customData": undefined,
"drawingConfigs": {
"pressureSensitivity": 1,
"simplify": "0.25000",
"streamline": "0.35000",
},
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
@ -8914,15 +8947,10 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
50,
],
],
"pressures": [
0,
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
@ -8991,6 +9019,11 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"backgroundColor": "transparent",
"boundElements": null,
"customData": undefined,
"drawingConfigs": {
"pressureSensitivity": 1,
"simplify": "0.25000",
"streamline": "0.35000",
},
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
@ -9022,15 +9055,10 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
50,
],
],
"pressures": [
0,
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
@ -9074,6 +9102,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -9340,6 +9369,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -9607,6 +9637,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -9839,6 +9870,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -10140,6 +10172,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -10482,6 +10515,7 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -10718,6 +10752,7 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -11168,6 +11203,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -11426,6 +11462,7 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -11665,6 +11702,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -11906,6 +11944,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -12033,6 +12072,11 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"backgroundColor": "transparent",
"boundElements": null,
"customData": undefined,
"drawingConfigs": {
"pressureSensitivity": 1,
"simplify": "0.25000",
"streamline": "0.35000",
},
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
@ -12061,14 +12105,10 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
10,
],
],
"pressures": [
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
@ -12087,6 +12127,11 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"backgroundColor": "transparent",
"boundElements": null,
"customData": undefined,
"drawingConfigs": {
"pressureSensitivity": 1,
"simplify": "0.25000",
"streamline": "0.35000",
},
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
@ -12115,14 +12160,10 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
10,
],
],
"pressures": [
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#e03131",
"strokeStyle": "solid",
"strokeWidth": 2,
@ -12231,6 +12272,11 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"backgroundColor": "transparent",
"boundElements": null,
"customData": undefined,
"drawingConfigs": {
"pressureSensitivity": 1,
"simplify": "0.25000",
"streamline": "0.35000",
},
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
@ -12258,14 +12304,10 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
10,
],
],
"pressures": [
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#e03131",
"strokeStyle": "solid",
"strokeWidth": 2,
@ -12309,6 +12351,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on s
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -12556,6 +12599,7 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -12797,6 +12841,7 @@ exports[`history > singleplayer undo/redo > should end up with no history entry
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -13038,6 +13083,7 @@ exports[`history > singleplayer undo/redo > should iterate through the history w
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -13287,6 +13333,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -13622,6 +13669,7 @@ exports[`history > singleplayer undo/redo > should not collapse when applying co
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -13794,6 +13842,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -14082,6 +14131,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -14349,6 +14399,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -14629,6 +14680,7 @@ exports[`history > singleplayer undo/redo > should support appstate name or view
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -14791,6 +14843,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -15492,6 +15545,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -16112,6 +16166,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -16732,6 +16787,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -17447,6 +17503,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -18200,6 +18257,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements'
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -18680,6 +18738,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -19203,6 +19262,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -19664,6 +19724,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,

View File

@ -23,6 +23,7 @@ exports[`given element A and group of elements B and given both are selected whe
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -445,6 +446,7 @@ exports[`given element A and group of elements B and given both are selected whe
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -857,6 +859,7 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1413,6 +1416,7 @@ exports[`regression tests > Drags selected element when hitting only bounding bo
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1618,6 +1622,7 @@ exports[`regression tests > adjusts z order when grouping > [end of test] appSta
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -1998,6 +2003,7 @@ exports[`regression tests > alt-drag duplicates an element > [end of test] appSt
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2234,6 +2240,7 @@ exports[`regression tests > arrow keys > [end of test] appState 1`] = `
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2414,6 +2421,7 @@ exports[`regression tests > can drag element that covers another element, while
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2737,6 +2745,7 @@ exports[`regression tests > change the properties of a shape > [end of test] app
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -2986,6 +2995,7 @@ exports[`regression tests > click on an element and drag it > [dragged] appState
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -3227,6 +3237,7 @@ exports[`regression tests > click on an element and drag it > [end of test] appS
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -3459,6 +3470,7 @@ exports[`regression tests > click to select a shape > [end of test] appState 1`]
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -3717,6 +3729,7 @@ exports[`regression tests > click-drag to select a group > [end of test] appStat
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -4031,6 +4044,7 @@ exports[`regression tests > deleting last but one element in editing group shoul
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -4461,6 +4475,7 @@ exports[`regression tests > deselects group of selected elements on pointer down
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -4746,6 +4761,7 @@ exports[`regression tests > deselects group of selected elements on pointer up w
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -5022,6 +5038,7 @@ exports[`regression tests > deselects selected element on pointer down when poin
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -5232,6 +5249,7 @@ exports[`regression tests > deselects selected element, on pointer up, when clic
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -5432,6 +5450,7 @@ exports[`regression tests > double click to edit a group > [end of test] appStat
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -5819,6 +5838,7 @@ exports[`regression tests > drags selected elements from point inside common bou
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -6112,6 +6132,7 @@ exports[`regression tests > draw every type of shape > [end of test] appState 1`
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -6856,6 +6877,11 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack
"backgroundColor": "transparent",
"boundElements": null,
"customData": undefined,
"drawingConfigs": {
"pressureSensitivity": 1,
"simplify": "0.25000",
"streamline": "0.35000",
},
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
@ -6883,14 +6909,10 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack
10,
],
],
"pressures": [
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
@ -6934,6 +6956,7 @@ exports[`regression tests > given a group of selected elements with an element t
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -7268,6 +7291,7 @@ exports[`regression tests > given a selected element A and a not selected elemen
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -7547,6 +7571,7 @@ exports[`regression tests > given selected element A with lower z-index than uns
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -7782,6 +7807,7 @@ exports[`regression tests > given selected element A with lower z-index than uns
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8020,6 +8046,7 @@ exports[`regression tests > key 2 selects rectangle tool > [end of test] appStat
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8200,6 +8227,7 @@ exports[`regression tests > key 3 selects diamond tool > [end of test] appState
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8380,6 +8408,7 @@ exports[`regression tests > key 4 selects ellipse tool > [end of test] appState
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8560,6 +8589,7 @@ exports[`regression tests > key 5 selects arrow tool > [end of test] appState 1`
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -8784,6 +8814,7 @@ exports[`regression tests > key 6 selects line tool > [end of test] appState 1`]
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -9008,6 +9039,7 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] appState
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -9124,6 +9156,11 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] undo sta
"backgroundColor": "transparent",
"boundElements": null,
"customData": undefined,
"drawingConfigs": {
"pressureSensitivity": 1,
"simplify": "0.25000",
"streamline": "0.35000",
},
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
@ -9151,14 +9188,10 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] undo sta
10,
],
],
"pressures": [
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
@ -9202,6 +9235,7 @@ exports[`regression tests > key a selects arrow tool > [end of test] appState 1`
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -9426,6 +9460,7 @@ exports[`regression tests > key d selects diamond tool > [end of test] appState
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -9606,6 +9641,7 @@ exports[`regression tests > key l selects line tool > [end of test] appState 1`]
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -9830,6 +9866,7 @@ exports[`regression tests > key o selects ellipse tool > [end of test] appState
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -10010,6 +10047,7 @@ exports[`regression tests > key p selects freedraw tool > [end of test] appState
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -10126,6 +10164,11 @@ exports[`regression tests > key p selects freedraw tool > [end of test] undo sta
"backgroundColor": "transparent",
"boundElements": null,
"customData": undefined,
"drawingConfigs": {
"pressureSensitivity": 1,
"simplify": "0.25000",
"streamline": "0.35000",
},
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
@ -10153,14 +10196,10 @@ exports[`regression tests > key p selects freedraw tool > [end of test] undo sta
10,
],
],
"pressures": [
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
@ -10204,6 +10243,7 @@ exports[`regression tests > key r selects rectangle tool > [end of test] appStat
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -10384,6 +10424,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] appSta
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -10884,6 +10925,7 @@ exports[`regression tests > noop interaction after undo shouldn't create history
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -11164,6 +11206,7 @@ exports[`regression tests > pinch-to-zoom works > [end of test] appState 1`] = `
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -11287,6 +11330,7 @@ exports[`regression tests > shift click on selected element should deselect it o
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -11487,6 +11531,7 @@ exports[`regression tests > shift-click to multiselect, then drag > [end of test
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -11802,6 +11847,7 @@ exports[`regression tests > should group elements and ungroup them > [end of tes
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -12219,6 +12265,7 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -12843,6 +12890,7 @@ exports[`regression tests > spacebar + drag scrolls the canvas > [end of test] a
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -12969,6 +13017,7 @@ exports[`regression tests > supports nested groups > [end of test] appState 1`]
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -13590,6 +13639,7 @@ exports[`regression tests > switches from group of selected elements to another
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -13931,6 +13981,7 @@ exports[`regression tests > switches selected element on pointer down > [end of
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -14197,6 +14248,7 @@ exports[`regression tests > two-finger scroll works > [end of test] appState 1`]
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -14320,6 +14372,7 @@ exports[`regression tests > undo/redo drawing an element > [end of test] appStat
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -14705,6 +14758,7 @@ exports[`regression tests > updates fontSize & fontFamily appState > [end of tes
"currentItemFontFamily": 8,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,
@ -14828,6 +14882,7 @@ exports[`regression tests > zoom hotkeys > [end of test] appState 1`] = `
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,

View File

@ -78,7 +78,7 @@ describe("actionStyles", () => {
expect(firstRect.strokeColor).toBe("#e03131");
expect(firstRect.backgroundColor).toBe("#a5d8ff");
expect(firstRect.fillStyle).toBe("cross-hatch");
expect(firstRect.strokeWidth).toBe(2); // Bold: 2
expect(firstRect.strokeWidth).toBe(4); // Bold: 4
expect(firstRect.strokeStyle).toBe("dotted");
expect(firstRect.roughness).toBe(2); // Cartoonist: 2
expect(firstRect.opacity).toBe(60);

View File

@ -381,7 +381,7 @@ describe("contextMenu element", () => {
expect(firstRect.strokeColor).toBe("#e03131");
expect(firstRect.backgroundColor).toBe("#a5d8ff");
expect(firstRect.fillStyle).toBe("cross-hatch");
expect(firstRect.strokeWidth).toBe(2); // Bold: 2
expect(firstRect.strokeWidth).toBe(4); // Bold: 4
expect(firstRect.strokeStyle).toBe("dotted");
expect(firstRect.roughness).toBe(2); // Cartoonist: 2
expect(firstRect.opacity).toBe(60);

View File

@ -170,6 +170,11 @@ exports[`restoreElements > should restore freedraw element correctly 1`] = `
"backgroundColor": "transparent",
"boundElements": [],
"customData": undefined,
"drawingConfigs": {
"pressureSensitivity": 1,
"simplify": "0.10000",
"streamline": "0.25000",
},
"fillStyle": "solid",
"frameId": null,
"groupIds": [],

View File

@ -333,6 +333,7 @@ export interface AppState {
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
currentItemRoughness: number;
currentItemOpacity: number;
currentItemPressureSensitivity: number;
currentItemFontFamily: FontFamilyValues;
currentItemFontSize: number;
currentItemTextAlign: TextAlign;

View File

@ -23,6 +23,7 @@ exports[`exportToSvg > with default arguments 1`] = `
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
"currentItemPressureSensitivity": 1,
"currentItemRoughness": 1,
"currentItemRoundness": "round",
"currentItemStartArrowhead": null,