Compare commits

...

36 Commits

Author SHA1 Message Date
Mark Tolmacs 385416d231 fix: Lint
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
2025-10-29 18:30:27 +01:00
Mark Tolmacs 4d04e3e9a1 chore: Additional master merge
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
2025-10-27 16:25:31 +01:00
Mark Tolmacs e08ebdec28 Merge branch 'master' into ryan-di/freedraw-width
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
2025-10-27 16:19:33 +01:00
Ryan Di 86605829c6 demo: a temp freehand solution to replace laser 2025-07-21 21:25:02 +10:00
dwelle c398af6c92 DISABLE DEBUG 2025-07-15 15:37:18 +02:00
dwelle 973f2a464d tweak icons 2025-07-15 13:09:37 +02:00
dwelle 02cef5ea92 Merge branch 'master' into ryan-di/freedraw-width
# Conflicts:
#	packages/excalidraw/package.json
2025-07-15 13:06:50 +02:00
dwelle d615c2cea1 rename drawingConfigs to freedrawOptions 2025-07-14 13:15:31 +02:00
dwelle 446f871536 Revert "differentiate between constant/variable stroke type"
This reverts commit 0199c82e98.
2025-07-08 23:44:54 +02:00
dwelle 34bff557e3 tweak icons 2025-07-08 23:42:42 +02:00
dwelle a0e54e3768 tweak fixed freedraw stroke width 2025-07-08 23:42:35 +02:00
dwelle d6ec1dc7e6 support extraBold for all element types 2025-07-08 23:42:08 +02:00
dwelle 62e20aa247 improve debug 2025-06-27 15:43:13 +02:00
dwelle 0199c82e98 differentiate between constant/variable stroke type 2025-06-27 14:18:48 +02:00
dwelle 3c07ff358a differentiate freedraw config based on input type 2025-06-27 14:07:12 +02:00
dwelle d9c85ff18f bump extraBold width to 8 2025-06-27 13:56:47 +02:00
dwelle 6d84fa21c5 chore: bump @excalidraw/laser-pointer@1.3.2 2025-06-27 13:39:47 +02:00
Ryan Di 5666fd8199 update snap 2025-06-27 20:51:50 +10:00
Ryan Di abdacf8239 code cleanup 2025-06-27 20:36:37 +10:00
Ryan Di 1068153b25 merge 2025-06-27 20:26:27 +10:00
Ryan Di 09876aba6d change to fixedStrokeWidth 2025-06-27 20:19:32 +10:00
dwelle 8ceb55dd02 Revert "remove debug and provide value for stylus"
This reverts commit c72c47f0cd.

# Conflicts:
#	packages/element/src/freedraw.ts
#	packages/excalidraw/tests/__snapshots__/history.test.tsx.snap
#	packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap
2025-06-26 22:21:47 +02:00
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
33 changed files with 1051 additions and 281 deletions
+1
View File
@@ -1143,6 +1143,7 @@ const ExcalidrawWrapper = () => {
ref={debugCanvasRef}
/>
)}
{/* <FreedrawDebugSliders /> */}
</Excalidraw>
</div>
);
@@ -0,0 +1,150 @@
import { STROKE_OPTIONS, isFreeDrawElement } from "@excalidraw/element";
import { useState, useEffect } from "react";
import { useUIAppState } from "@excalidraw/excalidraw/context/ui-appState";
import { useExcalidrawElements } from "@excalidraw/excalidraw/components/App";
import { round } from "../../packages/math/src";
export const FreedrawDebugSliders = () => {
const [streamline, setStreamline] = useState<number>(
STROKE_OPTIONS.default.streamline,
);
const [simplify, setSimplify] = useState<number>(
STROKE_OPTIONS.default.simplify,
);
useEffect(() => {
if (!window.h) {
window.h = {} as any;
}
if (!window.h.debugFreedraw) {
window.h.debugFreedraw = {
enabled: true,
...STROKE_OPTIONS.default,
};
}
setStreamline(window.h.debugFreedraw.streamline);
setSimplify(window.h.debugFreedraw.simplify);
}, []);
const handleStreamlineChange = (value: number) => {
setStreamline(value);
if (window.h && window.h.debugFreedraw) {
window.h.debugFreedraw.streamline = value;
}
};
const handleSimplifyChange = (value: number) => {
setSimplify(value);
if (window.h && window.h.debugFreedraw) {
window.h.debugFreedraw.simplify = value;
}
};
const [enabled, setEnabled] = useState<boolean>(
window.h?.debugFreedraw?.enabled ?? true,
);
// counter incrasing each 50ms
const [, setCounter] = useState<number>(0);
useEffect(() => {
const interval = setInterval(() => {
setCounter((prev) => prev + 1);
}, 50);
return () => clearInterval(interval);
}, []);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const elements = useExcalidrawElements();
const appState = useUIAppState();
const newFreedrawElement =
appState.newElement && isFreeDrawElement(appState.newElement)
? appState.newElement
: null;
return (
<div
style={{
position: "absolute",
bottom: "70px",
left: "50%",
transform: "translateX(-50%)",
zIndex: 9999,
padding: "10px",
borderRadius: "8px",
border: "1px solid #ccc",
display: "flex",
flexDirection: "column",
gap: "8px",
fontSize: "12px",
fontFamily: "monospace",
}}
>
{newFreedrawElement && (
<div>
pressures:{" "}
{newFreedrawElement.simulatePressure
? "simulated"
: JSON.stringify(
newFreedrawElement.pressures
.slice(-4)
.map((x) => round(x, 2))
.join(" ") || [],
)}{" "}
({round(window.__lastPressure__ || 0, 2) || "?"})
</div>
)}
<div>
<label>
{" "}
enabled
<br />
<input
type="checkbox"
checked={enabled}
onChange={(e) => {
if (window.h.debugFreedraw) {
window.h.debugFreedraw.enabled = e.target.checked;
setEnabled(e.target.checked);
}
}}
/>
</label>
</div>
<div>
<label>
Streamline: {streamline.toFixed(2)}
<br />
<input
type="range"
min="0"
max="1"
step="0.01"
value={streamline}
onChange={(e) => handleStreamlineChange(parseFloat(e.target.value))}
style={{ width: "150px" }}
/>
</label>
</div>
<div>
<label>
Simplify: {simplify.toFixed(2)}
<br />
<input
type="range"
min="0"
max="1"
step="0.01"
value={simplify}
onChange={(e) => handleSimplifyChange(parseFloat(e.target.value))}
style={{ width: "150px" }}
/>
</label>
</div>
</div>
);
};
@@ -1,34 +0,0 @@
import { defaultLang } from "@excalidraw/excalidraw/i18n";
import { UI } from "@excalidraw/excalidraw/tests/helpers/ui";
import {
screen,
fireEvent,
waitFor,
render,
} from "@excalidraw/excalidraw/tests/test-utils";
import ExcalidrawApp from "../App";
describe("Test LanguageList", () => {
it("rerenders UI on language change", async () => {
await render(<ExcalidrawApp />);
// select rectangle tool to show properties menu
UI.clickTool("rectangle");
// english lang should display `thin` label
expect(screen.queryByTitle(/thin/i)).not.toBeNull();
fireEvent.click(document.querySelector(".dropdown-menu-button")!);
fireEvent.change(document.querySelector(".dropdown-select__language")!, {
target: { value: "de-DE" },
});
// switching to german, `thin` label should no longer exist
await waitFor(() => expect(screen.queryByTitle(/thin/i)).toBeNull());
// reset language
fireEvent.change(document.querySelector(".dropdown-select__language")!, {
target: { value: defaultLang.code },
});
// switching back to English
await waitFor(() => expect(screen.queryByTitle(/thin/i)).not.toBeNull());
});
});
+4 -3
View File
@@ -442,8 +442,9 @@ export const ROUGHNESS = {
export const STROKE_WIDTH = {
thin: 1,
bold: 2,
extraBold: 4,
medium: 2,
bold: 4,
extraBold: 8,
} as const;
export const DEFAULT_ELEMENT_PROPS: {
@@ -459,7 +460,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,
+12 -5
View File
@@ -5,6 +5,7 @@ import {
invariant,
rescalePoints,
sizeOf,
STROKE_WIDTH,
} from "@excalidraw/common";
import {
@@ -832,9 +833,15 @@ export const getArrowheadPoints = (
// This value is selected by minimizing a minimum size with the last segment of the arrowhead
const lengthMultiplier =
arrowhead === "diamond" || arrowhead === "diamond_outline" ? 0.25 : 0.5;
const minSize = Math.min(size, length * lengthMultiplier);
const xs = x2 - nx * minSize;
const ys = y2 - ny * minSize;
// make arrowheads bigger for thick strokes
const strokeWidthMultiplier =
element.strokeWidth >= STROKE_WIDTH.extraBold ? 1.5 : 1;
const adjustedSize =
Math.min(size, length * lengthMultiplier) * strokeWidthMultiplier;
const xs = x2 - nx * adjustedSize;
const ys = y2 - ny * adjustedSize;
if (
arrowhead === "dot" ||
@@ -883,7 +890,7 @@ export const getArrowheadPoints = (
const [px, py] = element.points.length > 1 ? element.points[1] : [0, 0];
[ox, oy] = pointRotateRads(
pointFrom(x2 + minSize * 2, y2),
pointFrom(x2 + adjustedSize * 2, y2),
pointFrom(x2, y2),
Math.atan2(py - y2, px - x2) as Radians,
);
@@ -894,7 +901,7 @@ export const getArrowheadPoints = (
: [0, 0];
[ox, oy] = pointRotateRads(
pointFrom(x2 - minSize * 2, y2),
pointFrom(x2 - adjustedSize * 2, y2),
pointFrom(x2, y2),
Math.atan2(y2 - py, x2 - px) as Radians,
);
+373
View File
@@ -0,0 +1,373 @@
import { LaserPointer, type Point } from "@excalidraw/laser-pointer";
import {
clamp,
lineSegment,
pointFrom,
pointRotateRads,
round,
type LocalPoint,
} from "@excalidraw/math";
import getStroke from "perfect-freehand";
import { invariant } from "@excalidraw/common";
import type { GlobalPoint, Radians } from "@excalidraw/math";
import { getElementBounds } from "./bounds";
import type { StrokeOptions } from "perfect-freehand";
import type {
ElementsMap,
ExcalidrawFreeDrawElement,
PointerType,
} from "./types";
export const STROKE_OPTIONS: Record<
PointerType | "default",
{ streamline: number; simplify: number }
> = {
default: {
streamline: 0.35,
simplify: 0.1,
},
mouse: {
streamline: 0.6,
simplify: 0.1,
},
pen: {
// for optimal performance, we use a lower streamline and simplify
streamline: 0.2,
simplify: 0.1,
},
touch: {
streamline: 0.65,
simplify: 0.1,
},
} as const;
export const getFreedrawConfig = (eventType: string | null | undefined) => {
return (
STROKE_OPTIONS[(eventType as PointerType | null) || "default"] ||
STROKE_OPTIONS.default
);
};
/**
* 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,
fixedStrokeWidth: boolean | undefined,
maxDistance = 8, // Maximum expected distance for normalization
): number => {
if (fixedStrokeWidth) {
return 1;
}
// 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);
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.freedrawOptions?.fixedStrokeWidth) {
points = element.points.map(
([x, y]: LocalPoint): [number, number, number] => [x, y, 1],
);
} else 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.freedrawOptions?.fixedStrokeWidth,
),
]);
} else {
points = element.points.map(([x, y]: LocalPoint, i) => {
const rawPressure = element.pressures?.[i] ?? 0.5;
const amplifiedPressure = Math.pow(rawPressure, 0.6);
const adjustedPressure = amplifiedPressure;
return [x, y, clamp(adjustedPressure, 0.1, 1.0)];
});
}
const streamline =
element.freedrawOptions?.streamline ?? STROKE_OPTIONS.default.streamline;
const simplify =
element.freedrawOptions?.simplify ?? STROKE_OPTIONS.default.simplify;
const laser = new LaserPointer({
size: element.strokeWidth,
streamline,
simplify,
sizeMapping: ({ pressure: t }) => {
if (element.freedrawOptions?.fixedStrokeWidth) {
return 0.6;
}
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.freedrawOptions === null) {
return _legacy_getFreeDrawSvgPath(element);
}
return _transition_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",
)} `;
};
export 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 _transition_getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) {
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,
thinning: 0.6,
smoothing: 0.5,
streamline: 0.5,
easing: (t) => {
if (element.freedrawOptions?.fixedStrokeWidth) {
return 0.5;
}
return Math.sin((t * Math.PI) / 2) * 0.65;
}, // https://easings.net/#easeOutSine
last: !!element.lastCommittedPoint, // LastCommittedPoint is added on pointerup
};
return _legacy_getSvgPathFromStroke(
getStroke(inputPoints as number[][], options),
);
}
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]];
// 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 _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");
};
export function getFreedrawOutlineAsSegments(
element: ExcalidrawFreeDrawElement,
points: [number, number][],
elementsMap: ElementsMap,
) {
const bounds = getElementBounds(
{
...element,
angle: 0 as Radians,
},
elementsMap,
);
const center = pointFrom<GlobalPoint>(
(bounds[0] + bounds[2]) / 2,
(bounds[1] + bounds[3]) / 2,
);
invariant(points.length >= 2, "Freepath outline must have at least 2 points");
return points.slice(2).reduce(
(acc, curr) => {
acc.push(
lineSegment<GlobalPoint>(
acc[acc.length - 1][1],
pointRotateRads(
pointFrom<GlobalPoint>(curr[0] + element.x, curr[1] + element.y),
center,
element.angle,
),
),
);
return acc;
},
[
lineSegment<GlobalPoint>(
pointRotateRads(
pointFrom<GlobalPoint>(
points[0][0] + element.x,
points[0][1] + element.y,
),
center,
element.angle,
),
pointRotateRads(
pointFrom<GlobalPoint>(
points[1][0] + element.x,
points[1][1] + element.y,
),
center,
element.angle,
),
),
],
);
}
export function getFreedrawOutlinePoints(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 getStroke(inputPoints as number[][], options) as [number, number][];
}
+1
View File
@@ -94,6 +94,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";
+6
View File
@@ -445,6 +445,7 @@ export const newFreeDrawElement = (
points?: ExcalidrawFreeDrawElement["points"];
simulatePressure: boolean;
pressures?: ExcalidrawFreeDrawElement["pressures"];
strokeOptions?: ExcalidrawFreeDrawElement["freedrawOptions"];
} & ElementConstructorOpts,
): NonDeleted<ExcalidrawFreeDrawElement> => {
return {
@@ -453,6 +454,11 @@ export const newFreeDrawElement = (
pressures: opts.pressures || [],
simulatePressure: opts.simulatePressure,
lastCommittedPoint: null,
freedrawOptions: opts.strokeOptions || {
fixedStrokeWidth: true,
streamline: 0.25,
simplify: 0.1,
},
};
};
+4 -126
View File
@@ -1,14 +1,6 @@
import rough from "roughjs/bin/rough";
import { getStroke } from "perfect-freehand";
import {
type GlobalPoint,
isRightAngleRads,
lineSegment,
pointFrom,
pointRotateRads,
type Radians,
} from "@excalidraw/math";
import { isRightAngleRads } from "@excalidraw/math";
import {
BOUND_TEXT_PADDING,
@@ -21,7 +13,6 @@ import {
getFontString,
isRTL,
getVerticalOffset,
invariant,
} from "@excalidraw/common";
import type {
@@ -40,7 +31,7 @@ import type {
InteractiveCanvasRenderConfig,
} from "@excalidraw/excalidraw/scene/types";
import { getElementAbsoluteCoords, getElementBounds } from "./bounds";
import { getElementAbsoluteCoords } from "./bounds";
import { getUncroppedImageElement } from "./cropElement";
import { LinearElementEditor } from "./linearElementEditor";
import {
@@ -66,6 +57,8 @@ import { getCornerRadius } from "./utils";
import { ShapeCache } from "./shape";
import { getFreeDrawSvgPath } from "./freedraw";
import type {
ExcalidrawElement,
ExcalidrawTextElement,
@@ -78,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
@@ -1045,117 +1037,3 @@ export function generateFreeDrawShape(element: ExcalidrawFreeDrawElement) {
export function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement) {
return pathsCache.get(element);
}
export function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) {
return getSvgPathFromStroke(getFreedrawOutlinePoints(element));
}
export function getFreedrawOutlineAsSegments(
element: ExcalidrawFreeDrawElement,
points: [number, number][],
elementsMap: ElementsMap,
) {
const bounds = getElementBounds(
{
...element,
angle: 0 as Radians,
},
elementsMap,
);
const center = pointFrom<GlobalPoint>(
(bounds[0] + bounds[2]) / 2,
(bounds[1] + bounds[3]) / 2,
);
invariant(points.length >= 2, "Freepath outline must have at least 2 points");
return points.slice(2).reduce(
(acc, curr) => {
acc.push(
lineSegment<GlobalPoint>(
acc[acc.length - 1][1],
pointRotateRads(
pointFrom<GlobalPoint>(curr[0] + element.x, curr[1] + element.y),
center,
element.angle,
),
),
);
return acc;
},
[
lineSegment<GlobalPoint>(
pointRotateRads(
pointFrom<GlobalPoint>(
points[0][0] + element.x,
points[0][1] + element.y,
),
center,
element.angle,
),
pointRotateRads(
pointFrom<GlobalPoint>(
points[1][0] + element.x,
points[1][1] + element.y,
),
center,
element.angle,
),
),
],
);
}
export function getFreedrawOutlinePoints(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 getStroke(inputPoints as number[][], options) as [number, number][];
}
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");
}
+17 -10
View File
@@ -21,6 +21,7 @@ import {
assertNever,
COLOR_PALETTE,
LINE_POLYGON_POINT_MERGE_DISTANCE,
STROKE_WIDTH,
} from "@excalidraw/common";
import { RoughGenerator } from "roughjs/bin/generator";
@@ -202,7 +203,7 @@ export const generateRoughOptions = (
// hachureGap because if not specified, roughjs uses strokeWidth to
// calculate them (and we don't want the fills to be modified)
fillWeight: element.strokeWidth / 2,
hachureGap: element.strokeWidth * 4,
hachureGap: Math.min(element.strokeWidth, STROKE_WIDTH.bold) * 4,
roughness: adjustRoughness(element),
stroke: element.strokeColor,
preserveVertices:
@@ -806,15 +807,21 @@ 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.freedrawOptions === null
? simplify(element.points as LocalPoint[], 0.75)
: simplify(element.points as LocalPoint[], 1.5);
shape =
element.freedrawOptions === null
? generator.curve(points, {
...generateRoughOptions(element),
stroke: "none",
})
: generator.polygon(points, {
...generateRoughOptions(element),
stroke: "none",
});
} else {
shape = null;
}
+5
View File
@@ -380,6 +380,11 @@ export type ExcalidrawFreeDrawElement = _ExcalidrawElementBase &
pressures: readonly number[];
simulatePressure: boolean;
lastCommittedPoint: LocalPoint | null;
freedrawOptions: {
streamline?: number;
simplify?: number;
fixedStrokeWidth?: boolean;
} | null;
}>;
export type FileId = string & { _brand: "FileId" };
@@ -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",
);
@@ -43,6 +43,7 @@ import {
isArrowElement,
isBoundToContainer,
isElbowArrow,
isFreeDrawElement,
isLinearElement,
isLineElement,
isTextElement,
@@ -125,6 +126,9 @@ import {
ArrowheadCrowfootIcon,
ArrowheadCrowfootOneIcon,
ArrowheadCrowfootOneOrManyIcon,
strokeWidthFixedIcon,
strokeWidthVariableIcon,
StrokeWidthMediumIcon,
} from "../components/icons";
import { Fonts } from "../fonts";
@@ -521,6 +525,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",
@@ -542,26 +573,7 @@ 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={WIDTHS}
value={getFormValue(
elements,
app,
@@ -684,6 +696,70 @@ export const actionChangeStrokeStyle = register({
),
});
export const actionChangePressureSensitivity = register({
name: "changeStrokeType",
label: "labels.strokeType",
trackEvent: false,
perform: (elements, appState, value) => {
const updatedElements = changeProperty(elements, appState, (el) => {
if (isFreeDrawElement(el)) {
return newElementWith(el, {
freedrawOptions: {
...el.freedrawOptions,
fixedStrokeWidth: value,
},
});
}
return el;
});
return {
elements: updatedElements,
appState: { ...appState, currentItemFixedStrokeWidth: value },
captureUpdate: CaptureUpdateAction.IMMEDIATELY,
};
},
PanelComponent: ({ app, appState, updateData }) => {
const selectedElements = app.scene.getSelectedElements(app.state);
const freedraws = selectedElements.filter(isFreeDrawElement);
const currentValue =
freedraws.length > 0
? reduceToCommonValue(
freedraws,
(element) => element.freedrawOptions?.fixedStrokeWidth,
) ?? null
: appState.currentItemFixedStrokeWidth;
return (
<fieldset>
<legend>{t("labels.strokeType")}</legend>
<div className="buttonList">
<RadioSelection
group="pressure-sensitivity"
options={[
{
value: true,
text: t("labels.strokeWidthFixed"),
icon: strokeWidthFixedIcon,
testId: "pressure-fixed",
},
{
value: false,
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",
+1
View File
@@ -13,6 +13,7 @@ export {
actionChangeStrokeWidth,
actionChangeFillStyle,
actionChangeSloppiness,
actionChangePressureSensitivity,
actionChangeOpacity,
actionChangeFontSize,
actionChangeFontFamily,
+1
View File
@@ -69,6 +69,7 @@ export type ActionName =
| "changeStrokeStyle"
| "changeArrowhead"
| "changeArrowType"
| "changeStrokeType"
| "changeArrowProperties"
| "changeOpacity"
| "changeFontSize"
+6
View File
@@ -34,6 +34,7 @@ export const getDefaultAppState = (): Omit<
currentItemFontFamily: DEFAULT_FONT_FAMILY,
currentItemFontSize: DEFAULT_FONT_SIZE,
currentItemOpacity: DEFAULT_ELEMENT_PROPS.opacity,
currentItemFixedStrokeWidth: true,
currentItemRoughness: DEFAULT_ELEMENT_PROPS.roughness,
currentItemStartArrowhead: null,
currentItemStrokeColor: DEFAULT_ELEMENT_PROPS.strokeColor,
@@ -167,6 +168,11 @@ const APP_STATE_STORAGE_CONF = (<
server: false,
},
currentItemOpacity: { browser: true, export: false, server: false },
currentItemFixedStrokeWidth: {
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 },
+6 -2
View File
@@ -195,8 +195,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))) && (
+31 -1
View File
@@ -236,6 +236,8 @@ import {
hitElementBoundingBox,
isLineElement,
isSimpleArrow,
STROKE_OPTIONS,
getFreedrawConfig,
StoreDelta,
type ApplyToOptions,
positionElementsOnGrid,
@@ -7749,7 +7751,12 @@ class App extends React.Component<AppProps, AppState> {
y: gridY,
});
const simulatePressure = event.pressure === 0.5;
const simulatePressure =
event.pressure === 0.5 || event.pressure === 0 || event.pressure === 1;
window.__lastPressure__ = event.pressure;
const freedrawConfig = getFreedrawConfig(event.pointerType);
const element = newFreeDrawElement({
type: elementType,
@@ -7764,6 +7771,17 @@ class App extends React.Component<AppProps, AppState> {
opacity: this.state.currentItemOpacity,
roundness: null,
simulatePressure,
strokeOptions: {
fixedStrokeWidth: this.state.currentItemFixedStrokeWidth,
streamline:
(window.h?.debugFreedraw?.enabled
? window.h?.debugFreedraw?.streamline
: null) ?? freedrawConfig.streamline,
simplify:
(window.h?.debugFreedraw?.enabled
? window.h?.debugFreedraw?.simplify
: null) ?? freedrawConfig.simplify,
},
locked: false,
frameId: topLayerFrame ? topLayerFrame.id : null,
points: [pointFrom<LocalPoint>(0, 0)],
@@ -11476,6 +11494,7 @@ class App extends React.Component<AppProps, AppState> {
// -----------------------------------------------------------------------------
declare global {
interface Window {
__lastPressure__?: number;
h: {
scene: Scene;
elements: readonly ExcalidrawElement[];
@@ -11484,6 +11503,11 @@ declare global {
app: InstanceType<typeof App>;
history: History;
store: Store;
debugFreedraw?: {
streamline: number;
simplify: number;
enabled: boolean;
};
};
}
}
@@ -11492,6 +11516,12 @@ export const createTestHook = () => {
if (isTestEnv() || isDevEnv()) {
window.h = window.h || ({} as Window["h"]);
// Initialize debug freedraw parameters
window.h.debugFreedraw = {
enabled: true,
...(window.h.debugFreedraw || STROKE_OPTIONS.default),
};
Object.defineProperties(window.h, {
elements: {
configurable: true,
+81 -2
View File
@@ -1160,7 +1160,7 @@ export const StrokeWidthBaseIcon = createIcon(
modifiedTablerIconProps,
);
export const StrokeWidthBoldIcon = createIcon(
export const StrokeWidthMediumIcon = createIcon(
<path
d="M5 10h10"
stroke="currentColor"
@@ -1171,7 +1171,7 @@ export const StrokeWidthBoldIcon = createIcon(
modifiedTablerIconProps,
);
export const StrokeWidthExtraBoldIcon = createIcon(
export const StrokeWidthBoldIcon = createIcon(
<path
d="M5 10h10"
stroke="currentColor"
@@ -1182,6 +1182,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
@@ -2294,6 +2305,40 @@ export const elementLinkIcon = createIcon(
tablerIconProps,
);
export const strokeWidthFixedIcon = createIcon(
<g>
<path
d="M4 12 C 5 8, 6 8, 8 12"
fill="none"
strokeWidth="1"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8 12 C 9 16, 10 16, 12 12"
fill="none"
strokeWidth="1"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M12 12 C 14 8, 15 8, 16 12"
fill="none"
strokeWidth="1"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M16 12 C 17 16, 18 16, 19 12"
fill="none"
strokeWidth="1"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>,
tablerIconProps,
);
export const resizeIcon = createIcon(
<g strokeWidth={1.5}>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
@@ -2303,6 +2348,40 @@ export const resizeIcon = createIcon(
tablerIconProps,
);
export const strokeWidthVariableIcon = createIcon(
<g>
<path
d="M4 12 C 5 8, 6 8, 8 12"
fill="none"
stroke-width="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8 12 C 9 16, 10 16, 12 12"
fill="none"
stroke-width="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M12 12 C 14 8, 15 8, 16 12"
fill="none"
stroke-width="2.75"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M16 12 C 17 16, 18 16, 19 12"
fill="none"
stroke-width="3.25"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>,
tablerIconProps,
);
export const adjustmentsIcon = createIcon(
<g strokeWidth={1.5}>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
+2
View File
@@ -304,6 +304,8 @@ export const restoreElement = (
lastCommittedPoint: null,
simulatePressure: element.simulatePressure,
pressures: element.pressures,
// legacy, for backwards compatibility
freedrawOptions: element.freedrawOptions ?? null,
});
}
case "image":
+1 -1
View File
@@ -251,7 +251,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";
+3
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",
+1 -1
View File
@@ -82,7 +82,7 @@
"@excalidraw/common": "0.18.0",
"@excalidraw/element": "0.18.0",
"@excalidraw/math": "0.18.0",
"@excalidraw/laser-pointer": "1.3.1",
"@excalidraw/laser-pointer": "1.3.2",
"@excalidraw/mermaid-to-excalidraw": "1.1.3",
"@excalidraw/random-username": "1.1.0",
"@radix-ui/react-popover": "1.1.6",
@@ -894,6 +894,7 @@ exports[`contextMenu element > right-clicking on a group should select whole gro
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -1096,6 +1097,7 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -1313,6 +1315,7 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -1647,6 +1650,7 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -1981,6 +1985,7 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2198,6 +2203,7 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2442,6 +2448,7 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2743,6 +2750,7 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -3118,6 +3126,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"currentItemBackgroundColor": "#a5d8ff",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "cross-hatch",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 60,
@@ -3126,7 +3135,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"currentItemStartArrowhead": null,
"currentItemStrokeColor": "#e03131",
"currentItemStrokeStyle": "dotted",
"currentItemStrokeWidth": 2,
"currentItemStrokeWidth": 4,
"currentItemTextAlign": "left",
"cursorButton": "up",
"defaultSidebarDockedPreference": false,
@@ -3241,11 +3250,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": 1359939303,
"versionNonce": 2004587015,
"width": 20,
"x": -10,
"y": 0,
@@ -3270,14 +3279,14 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"opacity": 60,
"roughness": 2,
"roundness": null,
"seed": 640725609,
"seed": 941653321,
"strokeColor": "#e03131",
"strokeStyle": "dotted",
"strokeWidth": 2,
"strokeWidth": 4,
"type": "rectangle",
"updated": 1,
"version": 9,
"versionNonce": 908564423,
"version": 10,
"versionNonce": 1359939303,
"width": 20,
"x": 20,
"y": 30,
@@ -3286,7 +3295,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`] = `[]`;
@@ -3486,11 +3495,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"updated": {
"id3": {
"deleted": {
"strokeStyle": "dotted",
"strokeWidth": 4,
"version": 7,
},
"inserted": {
"strokeStyle": "solid",
"strokeWidth": 2,
"version": 6,
},
},
@@ -3511,11 +3520,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"updated": {
"id3": {
"deleted": {
"roughness": 2,
"strokeStyle": "dotted",
"version": 8,
},
"inserted": {
"roughness": 1,
"strokeStyle": "solid",
"version": 7,
},
},
@@ -3536,11 +3545,11 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"updated": {
"id3": {
"deleted": {
"opacity": 60,
"roughness": 2,
"version": 9,
},
"inserted": {
"opacity": 100,
"roughness": 1,
"version": 8,
},
},
@@ -3548,6 +3557,31 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
},
"id": "id17",
},
{
"appState": AppStateDelta {
"delta": Delta {
"deleted": {},
"inserted": {},
},
},
"elements": {
"added": {},
"removed": {},
"updated": {
"id3": {
"deleted": {
"opacity": 60,
"version": 10,
},
"inserted": {
"opacity": 100,
"version": 9,
},
},
},
},
"id": "id19",
},
{
"appState": AppStateDelta {
"delta": Delta {
@@ -3575,6 +3609,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"roughness": 2,
"strokeColor": "#e03131",
"strokeStyle": "dotted",
"strokeWidth": 4,
"version": 4,
},
"inserted": {
@@ -3584,12 +3619,13 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"roughness": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"version": 3,
},
},
},
},
"id": "id19",
"id": "id21",
},
]
`;
@@ -3614,6 +3650,7 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -3940,6 +3977,7 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -4266,6 +4304,7 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -5554,6 +5593,7 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -6774,6 +6814,7 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -7712,6 +7753,7 @@ exports[`contextMenu element > shows context menu for canvas > [end of test] app
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -8715,6 +8757,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -9709,6 +9752,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -20,6 +20,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -639,6 +640,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -1128,6 +1130,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -1495,6 +1498,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -1865,6 +1869,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2131,6 +2136,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2576,6 +2582,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2882,6 +2889,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -3204,6 +3212,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -3501,6 +3510,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -3790,6 +3800,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -4028,6 +4039,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -4288,6 +4300,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -4562,6 +4575,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -4794,6 +4808,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -5026,6 +5041,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -5276,6 +5292,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -5535,6 +5552,7 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -5796,6 +5814,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -6128,6 +6147,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemBackgroundColor": "#ffc9c9",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -6558,6 +6578,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -6935,6 +6956,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -7250,6 +7272,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -7569,6 +7592,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemBackgroundColor": "#ffc9c9",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -7802,6 +7826,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -8157,6 +8182,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -8512,6 +8538,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -8921,6 +8948,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -9024,6 +9052,11 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"freedrawOptions": {
"fixedStrokeWidth": true,
"simplify": "0.10000",
"streamline": "0.35000",
},
"groupIds": [],
"height": 50,
"id": "id0",
@@ -9054,15 +9087,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,
@@ -9131,6 +9159,11 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"freedrawOptions": {
"fixedStrokeWidth": true,
"simplify": "0.10000",
"streamline": "0.35000",
},
"groupIds": [],
"height": 50,
"index": "a0",
@@ -9160,15 +9193,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,
@@ -9211,6 +9239,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -9478,6 +9507,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"currentItemBackgroundColor": "#ffc9c9",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -9746,6 +9776,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"currentItemBackgroundColor": "#ffc9c9",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -9981,6 +10012,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -10281,6 +10313,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -10633,6 +10666,7 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -10872,6 +10906,7 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -11323,6 +11358,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r
"currentItemBackgroundColor": "#a5d8ff",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -11586,6 +11622,7 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -11824,6 +11861,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -12064,6 +12102,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -12197,6 +12236,11 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"freedrawOptions": {
"fixedStrokeWidth": true,
"simplify": "0.10000",
"streamline": "0.35000",
},
"groupIds": [],
"height": 10,
"id": "id5",
@@ -12223,14 +12267,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,
@@ -12251,6 +12291,11 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"freedrawOptions": {
"fixedStrokeWidth": true,
"simplify": "0.10000",
"streamline": "0.35000",
},
"groupIds": [],
"height": 10,
"id": "id9",
@@ -12277,14 +12322,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,
@@ -12395,6 +12436,11 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"freedrawOptions": {
"fixedStrokeWidth": true,
"simplify": "0.10000",
"streamline": "0.35000",
},
"groupIds": [],
"height": 10,
"index": "a2",
@@ -12420,14 +12466,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,
@@ -12470,6 +12512,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on e
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -12683,6 +12726,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on e
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -12893,6 +12937,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on i
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -13197,6 +13242,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on i
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -13498,6 +13544,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on s
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -13746,6 +13793,7 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -13986,6 +14034,7 @@ exports[`history > singleplayer undo/redo > should end up with no history entry
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -14226,6 +14275,7 @@ exports[`history > singleplayer undo/redo > should iterate through the history w
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -14476,6 +14526,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -14810,6 +14861,7 @@ exports[`history > singleplayer undo/redo > should not collapse when applying co
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -14983,6 +15035,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -15270,6 +15323,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -15536,6 +15590,7 @@ exports[`history > singleplayer undo/redo > should not modify anything on unrela
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -15692,6 +15747,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes
"currentItemBackgroundColor": "#a5d8ff",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -15977,6 +16033,7 @@ exports[`history > singleplayer undo/redo > should support appstate name or view
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -16142,6 +16199,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -16850,6 +16908,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -17488,6 +17547,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -18126,6 +18186,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -18848,6 +18909,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -19602,6 +19664,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements'
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -20085,6 +20148,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -20599,6 +20663,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -21061,6 +21126,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -20,6 +20,7 @@ exports[`given element A and group of elements B and given both are selected whe
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -449,6 +450,7 @@ exports[`given element A and group of elements B and given both are selected whe
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -868,6 +870,7 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -1437,6 +1440,7 @@ exports[`regression tests > Drags selected element when hitting only bounding bo
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -1647,6 +1651,7 @@ exports[`regression tests > adjusts z order when grouping > [end of test] appSta
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2034,6 +2039,7 @@ exports[`regression tests > alt-drag duplicates an element > [end of test] appSt
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2282,6 +2288,7 @@ exports[`regression tests > arrow keys > [end of test] appState 1`] = `
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2465,6 +2472,7 @@ exports[`regression tests > can drag element that covers another element, while
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -2793,6 +2801,7 @@ exports[`regression tests > change the properties of a shape > [end of test] app
"currentItemBackgroundColor": "#ffc9c9",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -3051,6 +3060,7 @@ exports[`regression tests > click on an element and drag it > [dragged] appState
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -3295,6 +3305,7 @@ exports[`regression tests > click on an element and drag it > [end of test] appS
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -3534,6 +3545,7 @@ exports[`regression tests > click to select a shape > [end of test] appState 1`]
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -3795,6 +3807,7 @@ exports[`regression tests > click-drag to select a group > [end of test] appStat
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -4112,6 +4125,7 @@ exports[`regression tests > deleting last but one element in editing group shoul
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -4551,6 +4565,7 @@ exports[`regression tests > deselects group of selected elements on pointer down
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -4837,6 +4852,7 @@ exports[`regression tests > deselects group of selected elements on pointer up w
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -5116,6 +5132,7 @@ exports[`regression tests > deselects selected element on pointer down when poin
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -5327,6 +5344,7 @@ exports[`regression tests > deselects selected element, on pointer up, when clic
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -5530,6 +5548,7 @@ exports[`regression tests > double click to edit a group > [end of test] appStat
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -5926,6 +5945,7 @@ exports[`regression tests > drags selected elements from point inside common bou
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -6226,6 +6246,7 @@ exports[`regression tests > draw every type of shape > [end of test] appState 1`
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -7010,6 +7031,11 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"freedrawOptions": {
"fixedStrokeWidth": true,
"simplify": "0.10000",
"streamline": "0.35000",
},
"groupIds": [],
"height": 10,
"index": "a7",
@@ -7035,14 +7061,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,
@@ -7085,6 +7107,7 @@ exports[`regression tests > given a group of selected elements with an element t
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -7422,6 +7445,7 @@ exports[`regression tests > given a selected element A and a not selected elemen
"currentItemBackgroundColor": "#ffc9c9",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -7704,6 +7728,7 @@ exports[`regression tests > given selected element A with lower z-index than uns
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -7942,6 +7967,7 @@ exports[`regression tests > given selected element A with lower z-index than uns
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -8185,6 +8211,7 @@ exports[`regression tests > key 2 selects rectangle tool > [end of test] appStat
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -8368,6 +8395,7 @@ exports[`regression tests > key 3 selects diamond tool > [end of test] appState
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -8551,6 +8579,7 @@ exports[`regression tests > key 4 selects ellipse tool > [end of test] appState
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -8734,6 +8763,7 @@ exports[`regression tests > key 5 selects arrow tool > [end of test] appState 1`
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -8967,6 +8997,7 @@ exports[`regression tests > key 6 selects line tool > [end of test] appState 1`]
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -9198,6 +9229,7 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] appState
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -9322,6 +9354,11 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] undo sta
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"freedrawOptions": {
"fixedStrokeWidth": true,
"simplify": "0.10000",
"streamline": "0.35000",
},
"groupIds": [],
"height": 30,
"index": "a0",
@@ -9347,14 +9384,10 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] undo sta
30,
],
],
"pressures": [
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
@@ -9397,6 +9430,7 @@ exports[`regression tests > key a selects arrow tool > [end of test] appState 1`
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -9630,6 +9664,7 @@ exports[`regression tests > key d selects diamond tool > [end of test] appState
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -9813,6 +9848,7 @@ exports[`regression tests > key l selects line tool > [end of test] appState 1`]
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -10044,6 +10080,7 @@ exports[`regression tests > key o selects ellipse tool > [end of test] appState
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -10227,6 +10264,7 @@ exports[`regression tests > key p selects freedraw tool > [end of test] appState
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -10351,6 +10389,11 @@ exports[`regression tests > key p selects freedraw tool > [end of test] undo sta
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"freedrawOptions": {
"fixedStrokeWidth": true,
"simplify": "0.10000",
"streamline": "0.35000",
},
"groupIds": [],
"height": 30,
"index": "a0",
@@ -10376,14 +10419,10 @@ exports[`regression tests > key p selects freedraw tool > [end of test] undo sta
30,
],
],
"pressures": [
0,
0,
0,
],
"pressures": [],
"roughness": 1,
"roundness": null,
"simulatePressure": false,
"simulatePressure": true,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
@@ -10426,6 +10465,7 @@ exports[`regression tests > key r selects rectangle tool > [end of test] appStat
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -10609,6 +10649,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] appSta
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -11143,6 +11184,7 @@ exports[`regression tests > noop interaction after undo shouldn't create history
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -11426,6 +11468,7 @@ exports[`regression tests > pinch-to-zoom works > [end of test] appState 1`] = `
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -11552,6 +11595,7 @@ exports[`regression tests > shift click on selected element should deselect it o
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -11755,6 +11799,7 @@ exports[`regression tests > shift-click to multiselect, then drag > [end of test
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -12077,6 +12122,7 @@ exports[`regression tests > should group elements and ungroup them > [end of tes
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -12509,6 +12555,7 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -13152,6 +13199,7 @@ exports[`regression tests > spacebar + drag scrolls the canvas > [end of test] a
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -13281,6 +13329,7 @@ exports[`regression tests > supports nested groups > [end of test] appState 1`]
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -13915,6 +13964,7 @@ exports[`regression tests > switches from group of selected elements to another
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -14257,6 +14307,7 @@ exports[`regression tests > switches selected element on pointer down > [end of
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -14524,6 +14575,7 @@ exports[`regression tests > two-finger scroll works > [end of test] appState 1`]
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -14650,6 +14702,7 @@ exports[`regression tests > undo/redo drawing an element > [end of test] appStat
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -15045,6 +15098,7 @@ exports[`regression tests > updates fontSize & fontFamily appState > [end of tes
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 8,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -15171,6 +15225,7 @@ exports[`regression tests > zoom hotkeys > [end of test] appState 1`] = `
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
@@ -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);
@@ -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);
@@ -170,6 +170,11 @@ exports[`restoreElements > should restore freedraw element correctly 1`] = `
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"freedrawOptions": {
"fixedStrokeWidth": true,
"simplify": "0.10000",
"streamline": "0.25000",
},
"groupIds": [],
"height": 100,
"id": "id-freedraw01",
+1
View File
@@ -333,6 +333,7 @@ export interface AppState {
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
currentItemRoughness: number;
currentItemOpacity: number;
currentItemFixedStrokeWidth: boolean;
currentItemFontFamily: FontFamilyValues;
currentItemFontSize: number;
currentItemTextAlign: TextAlign;
+1 -1
View File
@@ -49,7 +49,7 @@
},
"dependencies": {
"@braintree/sanitize-url": "6.0.2",
"@excalidraw/laser-pointer": "1.3.1",
"@excalidraw/laser-pointer": "1.3.2",
"browser-fs-access": "0.29.1",
"open-color": "1.9.1",
"pako": "2.0.3",
@@ -20,6 +20,7 @@ exports[`exportToSvg > with default arguments 1`] = `
"currentItemBackgroundColor": "transparent",
"currentItemEndArrowhead": "arrow",
"currentItemFillStyle": "solid",
"currentItemFixedStrokeWidth": true,
"currentItemFontFamily": 5,
"currentItemFontSize": 20,
"currentItemOpacity": 100,
+4 -4
View File
@@ -1442,10 +1442,10 @@
resolved "https://registry.yarnpkg.com/@excalidraw/eslint-config/-/eslint-config-1.0.3.tgz#2122ef7413ae77874ae9848ce0f1c6b3f0d8bbbd"
integrity sha512-GemHNF5Z6ga0BWBSX7GJaNBUchLu6RwTcAB84eX1MeckRNhNasAsPCdelDlFalz27iS4RuYEQh0bPE8SRxJgbQ==
"@excalidraw/laser-pointer@1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@excalidraw/laser-pointer/-/laser-pointer-1.3.1.tgz#7c40836598e8e6ad91f01057883ed8b88fb9266c"
integrity sha512-psA1z1N2qeAfsORdXc9JmD2y4CmDwmuMRxnNdJHZexIcPwaNEyIpNcelw+QkL9rz9tosaN9krXuKaRqYpRAR6g==
"@excalidraw/laser-pointer@1.3.2":
version "1.3.2"
resolved "https://registry.yarnpkg.com/@excalidraw/laser-pointer/-/laser-pointer-1.3.2.tgz#1f91182dfc77291df72551c83fa7bf9d740ad9ae"
integrity sha512-aKhVj3/lLV7TCkZr6q5kn9sBFxzpOQ/yyRwBGm6smsakMdp0o1FVp9HNKOPerEpkKEt34VTURekZLfqa3E1Few==
"@excalidraw/markdown-to-text@0.1.2":
version "0.1.2"