fix: Lint

This commit is contained in:
Mark Tolmacs
2025-11-10 16:20:59 +01:00
parent c533de515d
commit 31c0cb5b2f
4 changed files with 291 additions and 308 deletions

View File

@@ -42,7 +42,7 @@ const renderLine = (
context: CanvasRenderingContext2D, context: CanvasRenderingContext2D,
zoom: number, zoom: number,
segment: LineSegment<GlobalPoint>, segment: LineSegment<GlobalPoint>,
color: string color: string,
) => { ) => {
context.save(); context.save();
context.strokeStyle = color; context.strokeStyle = color;
@@ -57,7 +57,7 @@ const renderCubicBezier = (
context: CanvasRenderingContext2D, context: CanvasRenderingContext2D,
zoom: number, zoom: number,
[start, control1, control2, end]: Curve<GlobalPoint>, [start, control1, control2, end]: Curve<GlobalPoint>,
color: string color: string,
) => { ) => {
context.save(); context.save();
context.strokeStyle = color; context.strokeStyle = color;
@@ -69,7 +69,7 @@ const renderCubicBezier = (
control2[0] * zoom, control2[0] * zoom,
control2[1] * zoom, control2[1] * zoom,
end[0] * zoom, end[0] * zoom,
end[1] * zoom end[1] * zoom,
); );
context.stroke(); context.stroke();
context.restore(); context.restore();
@@ -94,7 +94,7 @@ const _renderBinding = (
zoom: number, zoom: number,
width: number, width: number,
height: number, height: number,
color: string color: string,
) => { ) => {
if (!binding.fixedPoint) { if (!binding.fixedPoint) {
console.warn("Binding must have a fixedPoint"); console.warn("Binding must have a fixedPoint");
@@ -102,12 +102,12 @@ const _renderBinding = (
} }
const bindable = elementsMap.get( const bindable = elementsMap.get(
binding.elementId binding.elementId,
) as ExcalidrawBindableElement; ) as ExcalidrawBindableElement;
const [x, y] = getGlobalFixedPointForBindableElement( const [x, y] = getGlobalFixedPointForBindableElement(
binding.fixedPoint, binding.fixedPoint,
bindable, bindable,
elementsMap elementsMap,
); );
context.save(); context.save();
@@ -121,7 +121,7 @@ const _renderBinding = (
x * zoom - width, x * zoom - width,
y * zoom + height, y * zoom + height,
x * zoom, x * zoom,
y * zoom y * zoom,
); );
context.stroke(); context.stroke();
context.restore(); context.restore();
@@ -134,10 +134,10 @@ const _renderBindableBinding = (
zoom: number, zoom: number,
width: number, width: number,
height: number, height: number,
color: string color: string,
) => { ) => {
const bindable = elementsMap.get( const bindable = elementsMap.get(
binding.elementId binding.elementId,
) as ExcalidrawBindableElement; ) as ExcalidrawBindableElement;
if (!binding.fixedPoint) { if (!binding.fixedPoint) {
console.warn("Binding must have a fixedPoint"); console.warn("Binding must have a fixedPoint");
@@ -147,7 +147,7 @@ const _renderBindableBinding = (
const [x, y] = getGlobalFixedPointForBindableElement( const [x, y] = getGlobalFixedPointForBindableElement(
binding.fixedPoint, binding.fixedPoint,
bindable, bindable,
elementsMap elementsMap,
); );
context.save(); context.save();
@@ -161,7 +161,7 @@ const _renderBindableBinding = (
x * zoom + width, x * zoom + width,
y * zoom - height, y * zoom - height,
x * zoom, x * zoom,
y * zoom y * zoom,
); );
context.stroke(); context.stroke();
context.restore(); context.restore();
@@ -170,7 +170,7 @@ const _renderBindableBinding = (
const renderBindings = ( const renderBindings = (
context: CanvasRenderingContext2D, context: CanvasRenderingContext2D,
elements: readonly OrderedExcalidrawElement[], elements: readonly OrderedExcalidrawElement[],
zoom: number zoom: number,
) => { ) => {
const elementsMap = arrayToMap(elements); const elementsMap = arrayToMap(elements);
const dim = 16; const dim = 16;
@@ -196,7 +196,7 @@ const renderBindings = (
zoom, zoom,
dim, dim,
dim, dim,
element.startBinding?.mode === "orbit" ? "red" : "black" element.startBinding?.mode === "orbit" ? "red" : "black",
); );
} }
@@ -215,7 +215,7 @@ const renderBindings = (
zoom, zoom,
dim, dim,
dim, dim,
element.endBinding?.mode === "orbit" ? "red" : "black" element.endBinding?.mode === "orbit" ? "red" : "black",
); );
} }
} }
@@ -227,7 +227,7 @@ const renderBindings = (
} }
const arrow = elementsMap.get( const arrow = elementsMap.get(
boundElement.id boundElement.id,
) as ExcalidrawArrowElement; ) as ExcalidrawArrowElement;
if (arrow && arrow.startBinding?.elementId === element.id) { if (arrow && arrow.startBinding?.elementId === element.id) {
@@ -238,7 +238,7 @@ const renderBindings = (
zoom, zoom,
dim, dim,
dim, dim,
"green" "green",
); );
} }
if (arrow && arrow.endBinding?.elementId === element.id) { if (arrow && arrow.endBinding?.elementId === element.id) {
@@ -249,7 +249,7 @@ const renderBindings = (
zoom, zoom,
dim, dim,
dim, dim,
"green" "green",
); );
} }
}); });
@@ -260,7 +260,7 @@ const renderBindings = (
const render = ( const render = (
frame: DebugElement[], frame: DebugElement[],
context: CanvasRenderingContext2D, context: CanvasRenderingContext2D,
appState: AppState appState: AppState,
) => { ) => {
frame.forEach((el: DebugElement) => { frame.forEach((el: DebugElement) => {
switch (true) { switch (true) {
@@ -269,7 +269,7 @@ const render = (
context, context,
appState.zoom.value, appState.zoom.value,
el.data as LineSegment<GlobalPoint>, el.data as LineSegment<GlobalPoint>,
el.color el.color,
); );
break; break;
case isCurve(el.data): case isCurve(el.data):
@@ -277,7 +277,7 @@ const render = (
context, context,
appState.zoom.value, appState.zoom.value,
el.data as Curve<GlobalPoint>, el.data as Curve<GlobalPoint>,
el.color el.color,
); );
break; break;
default: default:
@@ -290,11 +290,11 @@ const _debugRenderer = (
canvas: HTMLCanvasElement, canvas: HTMLCanvasElement,
appState: AppState, appState: AppState,
elements: readonly OrderedExcalidrawElement[], elements: readonly OrderedExcalidrawElement[],
scale: number scale: number,
) => { ) => {
const [normalizedWidth, normalizedHeight] = getNormalizedCanvasDimensions( const [normalizedWidth, normalizedHeight] = getNormalizedCanvasDimensions(
canvas, canvas,
scale scale,
); );
const context = bootstrapCanvas({ const context = bootstrapCanvas({
@@ -309,7 +309,7 @@ const _debugRenderer = (
context.save(); context.save();
context.translate( context.translate(
appState.scrollX * appState.zoom.value, appState.scrollX * appState.zoom.value,
appState.scrollY * appState.zoom.value appState.scrollY * appState.zoom.value,
); );
renderOrigin(context, appState.zoom.value); renderOrigin(context, appState.zoom.value);
@@ -334,7 +334,7 @@ const _debugRenderer = (
if (window.visualDebug) { if (window.visualDebug) {
window.visualDebug!.data = window.visualDebug!.data =
window.visualDebug?.data.map((frame) => window.visualDebug?.data.map((frame) =>
frame.filter((el) => el.permanent) frame.filter((el) => el.permanent),
) ?? []; ) ?? [];
} }
}; };
@@ -354,7 +354,7 @@ export const saveDebugState = (debug: { enabled: boolean }) => {
try { try {
localStorage.setItem( localStorage.setItem(
STORAGE_KEYS.LOCAL_STORAGE_DEBUG, STORAGE_KEYS.LOCAL_STORAGE_DEBUG,
JSON.stringify(debug) JSON.stringify(debug),
); );
} catch (error: any) { } catch (error: any) {
console.error(error); console.error(error);
@@ -366,18 +366,18 @@ export const debugRenderer = throttleRAF(
canvas: HTMLCanvasElement, canvas: HTMLCanvasElement,
appState: AppState, appState: AppState,
elements: readonly OrderedExcalidrawElement[], elements: readonly OrderedExcalidrawElement[],
scale: number scale: number,
) => { ) => {
_debugRenderer(canvas, appState, elements, scale); _debugRenderer(canvas, appState, elements, scale);
}, },
{ trailing: true } { trailing: true },
); );
export const loadSavedDebugState = () => { export const loadSavedDebugState = () => {
let debug; let debug;
try { try {
const savedDebugState = localStorage.getItem( const savedDebugState = localStorage.getItem(
STORAGE_KEYS.LOCAL_STORAGE_DEBUG STORAGE_KEYS.LOCAL_STORAGE_DEBUG,
); );
if (savedDebugState) { if (savedDebugState) {
debug = JSON.parse(savedDebugState) as { enabled: boolean }; debug = JSON.parse(savedDebugState) as { enabled: boolean };
@@ -517,7 +517,7 @@ const DebugCanvas = React.forwardRef<HTMLCanvasElement, DebugCanvasProps>(
Debug Canvas Debug Canvas
</canvas> </canvas>
); );
} },
); );
export default DebugCanvas; export default DebugCanvas;

View File

@@ -1,5 +1,4 @@
import { import {
debugDrawLine,
DEFAULT_ADAPTIVE_RADIUS, DEFAULT_ADAPTIVE_RADIUS,
DEFAULT_PROPORTIONAL_RADIUS, DEFAULT_PROPORTIONAL_RADIUS,
invariant, invariant,
@@ -599,9 +598,5 @@ export const projectFixedPointOntoDiagonal = (
p = p1 || p2 || null; p = p1 || p2 || null;
} }
debugDrawLine(diagonalOne, { color: "purple", permanent: false });
debugDrawLine(diagonalTwo, { color: "purple", permanent: false });
debugDrawLine(intersector, { color: "orange", permanent: false });
return p && isPointInElement(p, element, elementsMap) ? p : null; return p && isPointInElement(p, element, elementsMap) ? p : null;
}; };

View File

@@ -200,15 +200,15 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"endBinding": { "endBinding": {
"elementId": "id1", "elementId": "id1",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.41067",
"0.59962", "0.58933",
], ],
"mode": "orbit", "mode": "orbit",
}, },
"fillStyle": "solid", "fillStyle": "solid",
"frameId": null, "frameId": null,
"groupIds": [], "groupIds": [],
"height": "0.56170", "height": "2.32745",
"id": "id4", "id": "id4",
"index": "a2", "index": "a2",
"isDeleted": false, "isDeleted": false,
@@ -223,7 +223,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
[ [
"88.00000", "88.00000",
"0.56170", "-2.32745",
], ],
], ],
"roughness": 1, "roughness": 1,
@@ -234,8 +234,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
"1.06000", "0.63636",
"0.59400", "0.63636",
], ],
"mode": "orbit", "mode": "orbit",
}, },
@@ -244,10 +244,10 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 17, "version": 19,
"width": "88.00000", "width": "88.00000",
"x": 6, "x": 6,
"y": "9.40000", "y": "12.50533",
} }
`; `;
@@ -476,7 +476,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
}, },
"id4": { "id4": {
"deleted": { "deleted": {
"height": "103.96874", "height": "67.32283",
"points": [ "points": [
[ [
0, 0,
@@ -484,21 +484,21 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
[ [
"88.00000", "88.00000",
"103.96874", "67.32283",
], ],
], ],
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
"1.06000", "0.63636",
"0.59400", "0.63636",
], ],
"mode": "orbit", "mode": "orbit",
}, },
"version": 16, "version": 16,
"width": "88.00000", "width": "88.00000",
"x": 6, "x": 6,
"y": "9.40000", "y": "46.04591",
}, },
"inserted": { "inserted": {
"height": 0, "height": 0,
@@ -513,7 +513,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
], ],
"startBinding": null, "startBinding": null,
"version": 14, "version": 13,
"width": 100, "width": 100,
"x": 0, "x": 0,
"y": 0, "y": 0,
@@ -577,12 +577,12 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"endBinding": { "endBinding": {
"elementId": "id1", "elementId": "id1",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.41067",
"0.59962", "0.58933",
], ],
"mode": "orbit", "mode": "orbit",
}, },
"height": "0.56170", "height": "2.32745",
"points": [ "points": [
[ [
0, 0,
@@ -590,19 +590,20 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
[ [
"88.00000", "88.00000",
"0.56170", "-2.32745",
], ],
], ],
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
"1.06000", "0.63636",
"0.59400", "0.63636",
], ],
"mode": "orbit", "mode": "orbit",
}, },
"version": 17, "version": 19,
"width": "88.00000", "width": "88.00000",
"y": "12.50533",
}, },
"inserted": { "inserted": {
"endBinding": { "endBinding": {
@@ -613,7 +614,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
"mode": "orbit", "mode": "orbit",
}, },
"height": "103.96874", "height": "67.32283",
"points": [ "points": [
[ [
0, 0,
@@ -621,19 +622,20 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
[ [
"88.00000", "88.00000",
"103.96874", "67.32283",
], ],
], ],
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
"1.06000", "0.63636",
"0.59400", "0.63636",
], ],
"mode": "orbit", "mode": "orbit",
}, },
"version": 16, "version": 16,
"width": "88.00000", "width": "88.00000",
"y": "46.04591",
}, },
}, },
}, },
@@ -766,12 +768,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
{ {
"angle": 0, "angle": 0,
"backgroundColor": "transparent", "backgroundColor": "transparent",
"boundElements": [ "boundElements": [],
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined, "customData": undefined,
"fillStyle": "solid", "fillStyle": "solid",
"frameId": null, "frameId": null,
@@ -790,7 +787,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"strokeWidth": 2, "strokeWidth": 2,
"type": "rectangle", "type": "rectangle",
"updated": 1, "updated": 1,
"version": 8, "version": 14,
"width": 100, "width": 100,
"x": 150, "x": 150,
"y": -50, "y": -50,
@@ -801,12 +798,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
{ {
"angle": 0, "angle": 0,
"backgroundColor": "transparent", "backgroundColor": "transparent",
"boundElements": [ "boundElements": [],
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined, "customData": undefined,
"fillStyle": "solid", "fillStyle": "solid",
"frameId": null, "frameId": null,
@@ -825,7 +817,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"strokeWidth": 2, "strokeWidth": 2,
"type": "rectangle", "type": "rectangle",
"updated": 1, "updated": 1,
"version": 6, "version": 9,
"width": 100, "width": 100,
"x": 150, "x": 150,
"y": -50, "y": -50,
@@ -840,14 +832,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"customData": undefined, "customData": undefined,
"elbowed": false, "elbowed": false,
"endArrowhead": "arrow", "endArrowhead": "arrow",
"endBinding": { "endBinding": null,
"elementId": "id1",
"fixedPoint": [
"-0.06000",
"0.59962",
],
"mode": "orbit",
},
"fillStyle": "solid", "fillStyle": "solid",
"frameId": null, "frameId": null,
"groupIds": [], "groupIds": [],
@@ -865,7 +850,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
0, 0,
], ],
[ [
0, 100,
0, 0,
], ],
], ],
@@ -874,31 +859,199 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"type": 2, "type": 2,
}, },
"startArrowhead": null, "startArrowhead": null,
"startBinding": { "startBinding": null,
"elementId": "id0",
"fixedPoint": [
"1.06000",
"0.59400",
],
"mode": "orbit",
},
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 20, "version": 26,
"width": 0, "width": 100,
"x": 144, "x": 150,
"y": "9.96170", "y": 0,
} }
`; `;
exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] number of elements 1`] = `3`; exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] number of elements 1`] = `3`;
exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] number of renders 1`] = `17`; exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] number of renders 1`] = `24`;
exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] redo stack 1`] = `[]`; exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] redo stack 1`] = `
[
{
"appState": AppStateDelta {
"delta": Delta {
"deleted": {},
"inserted": {},
},
},
"elements": {
"added": {},
"removed": {},
"updated": {
"id0": {
"deleted": {
"version": 13,
},
"inserted": {
"version": 12,
},
},
"id1": {
"deleted": {
"boundElements": [],
"version": 9,
},
"inserted": {
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"version": 8,
},
},
"id4": {
"deleted": {
"endBinding": null,
"height": "5.28000",
"points": [
[
0,
0,
],
[
-44,
"-5.28000",
],
],
"startBinding": {
"elementId": "id0",
"fixedPoint": [
"0.63636",
"0.63636",
],
"mode": "orbit",
},
"version": 25,
"width": 44,
"y": "5.28000",
},
"inserted": {
"endBinding": {
"elementId": "id1",
"fixedPoint": [
"0.41095",
"0.58905",
],
"mode": "orbit",
},
"height": "9.88589",
"points": [
[
0,
0,
],
[
"47.09529",
"9.88589",
],
],
"startBinding": {
"elementId": "id0",
"fixedPoint": [
"0.63636",
"0.63636",
],
"mode": "orbit",
},
"version": 24,
"width": "47.09529",
"y": "-0.98118",
},
},
},
},
"id": "id21",
},
{
"appState": AppStateDelta {
"delta": Delta {
"deleted": {},
"inserted": {},
},
},
"elements": {
"added": {},
"removed": {},
"updated": {
"id0": {
"deleted": {
"boundElements": [],
"version": 14,
},
"inserted": {
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"version": 13,
},
},
"id4": {
"deleted": {
"height": 0,
"points": [
[
0,
0,
],
[
100,
0,
],
],
"startBinding": null,
"version": 26,
"width": 100,
"x": 150,
"y": 0,
},
"inserted": {
"height": "5.28000",
"points": [
[
0,
0,
],
[
-44,
"-5.28000",
],
],
"startBinding": {
"elementId": "id0",
"fixedPoint": [
"0.63636",
"0.63636",
],
"mode": "orbit",
},
"version": 25,
"width": 44,
"x": 144,
"y": "5.28000",
},
},
},
},
"id": "id22",
},
]
`;
exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] undo stack 1`] = ` exports[`history > multiplayer undo/redo > conflicts in arrows and their bindable elements > should rebind bindings when both are updated through the history and there are no conflicting updates in the meantime > [end of test] undo stack 1`] = `
[ [
@@ -1053,176 +1206,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
}, },
"id": "id6", "id": "id6",
}, },
{
"appState": AppStateDelta {
"delta": Delta {
"deleted": {},
"inserted": {},
},
},
"elements": {
"added": {},
"removed": {},
"updated": {
"id0": {
"deleted": {
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"version": 7,
},
"inserted": {
"boundElements": [],
"version": 6,
},
},
"id4": {
"deleted": {
"height": "2.65128",
"points": [
[
0,
0,
],
[
-44,
"-2.65128",
],
],
"startBinding": {
"elementId": "id0",
"fixedPoint": [
"1.06000",
"0.59400",
],
"mode": "orbit",
},
"version": 17,
"width": 44,
"x": 144,
"y": "2.65128",
},
"inserted": {
"height": 0,
"points": [
[
0,
0,
],
[
100,
0,
],
],
"startBinding": null,
"version": 15,
"width": 100,
"x": 150,
"y": 0,
},
},
},
},
"id": "id15",
},
{
"appState": AppStateDelta {
"delta": Delta {
"deleted": {},
"inserted": {},
},
},
"elements": {
"added": {},
"removed": {},
"updated": {
"id0": {
"deleted": {
"version": 8,
},
"inserted": {
"version": 7,
},
},
"id1": {
"deleted": {
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"version": 6,
},
"inserted": {
"boundElements": [],
"version": 5,
},
},
"id4": {
"deleted": {
"endBinding": {
"elementId": "id1",
"fixedPoint": [
"-0.06000",
"0.59962",
],
"mode": "orbit",
},
"height": 0,
"points": [
[
0,
0,
],
[
0,
0,
],
],
"startBinding": {
"elementId": "id0",
"fixedPoint": [
"1.06000",
"0.59400",
],
"mode": "orbit",
},
"version": 20,
"width": 0,
},
"inserted": {
"endBinding": null,
"height": "2.65128",
"points": [
[
0,
0,
],
[
-44,
"-2.65128",
],
],
"startBinding": {
"elementId": "id0",
"fixedPoint": [
"1.06000",
"0.59400",
],
"mode": "orbit",
},
"version": 17,
"width": 44,
},
},
},
},
"id": "id16",
},
] ]
`; `;
@@ -2406,7 +2389,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"endBinding": { "endBinding": {
"elementId": "id1", "elementId": "id1",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -2439,7 +2422,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -2449,7 +2432,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 8, "version": 9,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
@@ -2485,7 +2468,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"id4": { "id4": {
"deleted": { "deleted": {
"isDeleted": true, "isDeleted": true,
"version": 8, "version": 9,
}, },
"inserted": { "inserted": {
"angle": 0, "angle": 0,
@@ -2497,7 +2480,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"endBinding": { "endBinding": {
"elementId": "id1", "elementId": "id1",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -2529,7 +2512,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -2538,7 +2521,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
@@ -16393,7 +16376,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -16426,7 +16409,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -16436,7 +16419,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
@@ -16700,7 +16683,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -16732,7 +16715,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -16741,14 +16724,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
}, },
"inserted": { "inserted": {
"isDeleted": true, "isDeleted": true,
"version": 6, "version": 7,
}, },
}, },
}, },
@@ -17033,7 +17016,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -17066,7 +17049,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -17076,7 +17059,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
@@ -17340,7 +17323,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -17372,7 +17355,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -17381,14 +17364,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
}, },
"inserted": { "inserted": {
"isDeleted": true, "isDeleted": true,
"version": 6, "version": 7,
}, },
}, },
}, },
@@ -17673,7 +17656,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -17706,7 +17689,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -17716,7 +17699,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
@@ -17980,7 +17963,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -18012,7 +17995,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -18021,14 +18004,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
}, },
"inserted": { "inserted": {
"isDeleted": true, "isDeleted": true,
"version": 6, "version": 7,
}, },
}, },
}, },
@@ -18313,7 +18296,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -18346,7 +18329,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -18356,7 +18339,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
@@ -18620,7 +18603,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -18652,7 +18635,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -18661,14 +18644,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
}, },
"inserted": { "inserted": {
"isDeleted": true, "isDeleted": true,
"version": 6, "version": 7,
}, },
}, },
}, },
@@ -18953,7 +18936,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -18986,7 +18969,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -18996,7 +18979,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
@@ -19260,7 +19243,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"endBinding": { "endBinding": {
"elementId": "id2", "elementId": "id2",
"fixedPoint": [ "fixedPoint": [
"-0.06000", "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -19292,7 +19275,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"startBinding": { "startBinding": {
"elementId": "id0", "elementId": "id0",
"fixedPoint": [ "fixedPoint": [
1, "0.50010",
"0.50010", "0.50010",
], ],
"mode": "orbit", "mode": "orbit",
@@ -19301,14 +19284,14 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"type": "arrow", "type": "arrow",
"version": 7, "version": 8,
"width": 88, "width": 88,
"x": 6, "x": 6,
"y": "0.01000", "y": "0.01000",
}, },
"inserted": { "inserted": {
"isDeleted": true, "isDeleted": true,
"version": 6, "version": 7,
}, },
}, },
}, },

View File

@@ -6305,6 +6305,7 @@ exports[`regression tests > draw every type of shape > [end of test] appState 1`
"elementId": "id20", "elementId": "id20",
"hoverPointIndex": -1, "hoverPointIndex": -1,
"initialState": { "initialState": {
"altFocusPoint": null,
"arrowStartIsInside": false, "arrowStartIsInside": false,
"lastClickedPoint": -1, "lastClickedPoint": -1,
"origin": null, "origin": null,
@@ -8769,6 +8770,7 @@ exports[`regression tests > key 5 selects arrow tool > [end of test] appState 1`
"elementId": "id0", "elementId": "id0",
"hoverPointIndex": -1, "hoverPointIndex": -1,
"initialState": { "initialState": {
"altFocusPoint": null,
"arrowStartIsInside": false, "arrowStartIsInside": false,
"lastClickedPoint": -1, "lastClickedPoint": -1,
"origin": null, "origin": null,
@@ -9001,6 +9003,7 @@ exports[`regression tests > key 6 selects line tool > [end of test] appState 1`]
"elementId": "id0", "elementId": "id0",
"hoverPointIndex": -1, "hoverPointIndex": -1,
"initialState": { "initialState": {
"altFocusPoint": null,
"arrowStartIsInside": false, "arrowStartIsInside": false,
"lastClickedPoint": -1, "lastClickedPoint": -1,
"origin": null, "origin": null,
@@ -9426,6 +9429,7 @@ exports[`regression tests > key a selects arrow tool > [end of test] appState 1`
"elementId": "id0", "elementId": "id0",
"hoverPointIndex": -1, "hoverPointIndex": -1,
"initialState": { "initialState": {
"altFocusPoint": null,
"arrowStartIsInside": false, "arrowStartIsInside": false,
"lastClickedPoint": -1, "lastClickedPoint": -1,
"origin": null, "origin": null,
@@ -9841,6 +9845,7 @@ exports[`regression tests > key l selects line tool > [end of test] appState 1`]
"elementId": "id0", "elementId": "id0",
"hoverPointIndex": -1, "hoverPointIndex": -1,
"initialState": { "initialState": {
"altFocusPoint": null,
"arrowStartIsInside": false, "arrowStartIsInside": false,
"lastClickedPoint": -1, "lastClickedPoint": -1,
"origin": null, "origin": null,