render fill directly from animated trail

This commit is contained in:
Ryan Di 2025-04-03 16:43:43 +11:00
parent 7a9df73e0b
commit 1e1dab3bbc
11 changed files with 11 additions and 194 deletions

View file

@ -705,33 +705,6 @@ export const renderSelectionElement = (
context.restore();
};
export const renderLassoSelection = (
lassoPath: AppState["lassoSelection"],
context: CanvasRenderingContext2D,
appState: InteractiveCanvasAppState,
selectionColor: InteractiveCanvasRenderConfig["selectionColor"],
) => {
if (!lassoPath || lassoPath.points.length < 2) {
return;
}
context.save();
context.translate(appState.scrollX, appState.scrollY);
context.beginPath();
for (const point of lassoPath.points) {
context.lineTo(point[0], point[1]);
}
context.closePath();
context.globalAlpha = 0.05;
context.fillStyle = selectionColor;
context.fill();
context.restore();
};
export const renderElement = (
element: NonDeletedExcalidrawElement,
elementsMap: RenderableElementsMap,

View file

@ -23,6 +23,7 @@ export interface Trail {
export interface AnimatedTrailOptions {
fill: (trail: AnimatedTrail) => string;
stroke?: (trail: AnimatedTrail) => string;
animateTrail?: boolean;
}
@ -161,10 +162,13 @@ export class AnimatedTrail implements Trail {
this.trailElement.setAttribute("d", svgPaths);
if (this.trailAnimation) {
this.trailElement.setAttribute("fill", "transparent");
this.trailElement.setAttribute(
"fill",
(this.options.fill ?? (() => "black"))(this),
);
this.trailElement.setAttribute(
"stroke",
(this.options.fill ?? (() => "black"))(this),
(this.options.stroke ?? (() => "black"))(this),
);
} else {
this.trailElement.setAttribute(

View file

@ -90,7 +90,6 @@ export const getDefaultAppState = (): Omit<
selectedGroupIds: {},
selectedElementsAreBeingDragged: false,
selectionElement: null,
lassoSelection: null,
shouldCacheIgnoreZoom: false,
stats: {
open: false,
@ -222,7 +221,6 @@ const APP_STATE_STORAGE_CONF = (<
server: false,
},
selectionElement: { browser: false, export: false, server: false },
lassoSelection: { browser: false, export: false, server: false },
shouldCacheIgnoreZoom: { browser: true, export: false, server: false },
stats: { browser: true, export: false, server: false },
startBoundElement: { browser: false, export: false, server: false },

View file

@ -199,7 +199,6 @@ const getRelevantAppStateProps = (
theme: appState.theme,
pendingImageElementId: appState.pendingImageElementId,
selectionElement: appState.selectionElement,
lassoSelection: appState.lassoSelection,
selectedGroupIds: appState.selectedGroupIds,
selectedLinearElement: appState.selectedLinearElement,
multiElement: appState.multiElement,

View file

@ -58,11 +58,12 @@ export class LassoTrail extends AnimatedTrail {
return Math.min(easeOut(l), easeOut(t));
},
fill: () => "rgba(0,118,255)",
fill: () => "rgba(105,101,219,0.05)",
stroke: () => "rgba(105,101,219)",
});
}
async startPath(x: number, y: number, keepPreviousSelection = false) {
startPath(x: number, y: number, keepPreviousSelection = false) {
// clear any existing trails just in case
this.endPath();
@ -159,19 +160,10 @@ export class LassoTrail extends AnimatedTrail {
this.keepPreviousSelection = keepPreviousSelection;
this.app.setState({
lassoSelection: {
points:
(this.getCurrentTrail()?.originalPoints?.map((p) =>
pointFrom<GlobalPoint>(p[0], p[1]),
) as readonly GlobalPoint[]) ?? null,
},
});
this.updateSelection();
};
private updateSelection = async () => {
private updateSelection = () => {
const lassoPath = super
.getCurrentTrail()
?.originalPoints?.map((p) => pointFrom<GlobalPoint>(p[0], p[1]));
@ -205,8 +197,5 @@ export class LassoTrail extends AnimatedTrail {
this.intersectedElements.clear();
this.enclosedElements.clear();
this.elementsSegments = null;
this.app.setState({
lassoSelection: null,
});
}
}

View file

@ -37,10 +37,7 @@ import {
import { getCornerRadius } from "@excalidraw/element/shapes";
import {
renderLassoSelection,
renderSelectionElement,
} from "@excalidraw/element/renderElement";
import { renderSelectionElement } from "@excalidraw/element/renderElement";
import {
isSelectedViaGroup,
@ -839,15 +836,6 @@ const _renderInteractiveScene = ({
}
}
if (appState.lassoSelection) {
renderLassoSelection(
appState.lassoSelection,
context,
appState,
renderConfig.selectionColor,
);
}
if (
appState.editingTextElement &&
isTextElement(appState.editingTextElement)

View file

@ -934,7 +934,6 @@ exports[`contextMenu element > right-clicking on a group should select whole gro
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -1145,7 +1144,6 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -1366,7 +1364,6 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -1702,7 +1699,6 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -2038,7 +2034,6 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -2259,7 +2254,6 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -2504,7 +2498,6 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -2810,7 +2803,6 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -3184,7 +3176,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -3664,7 +3655,6 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -3992,7 +3982,6 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -4320,7 +4309,6 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -5602,7 +5590,6 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -6825,7 +6812,6 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -7765,7 +7751,6 @@ exports[`contextMenu element > shows context menu for canvas > [end of test] app
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -8773,7 +8758,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -9763,7 +9747,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",

View file

@ -60,7 +60,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -661,7 +660,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -1170,7 +1168,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -1543,7 +1540,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -1917,7 +1913,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -2189,7 +2184,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -2630,7 +2624,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -2934,7 +2927,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -3223,7 +3215,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -3522,7 +3513,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -3813,7 +3803,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -4053,7 +4042,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -4317,7 +4305,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -4595,7 +4582,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -4831,7 +4817,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -5067,7 +5052,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -5301,7 +5285,6 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -5535,7 +5518,6 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -5799,7 +5781,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -6135,7 +6116,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -6565,7 +6545,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -6948,7 +6927,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -7272,7 +7250,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -7575,7 +7552,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -7809,7 +7785,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -8169,7 +8144,6 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -8529,7 +8503,6 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -8938,7 +8911,6 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -9230,7 +9202,6 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -9500,7 +9471,6 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -9769,7 +9739,6 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -10005,7 +9974,6 @@ exports[`history > multiplayer undo/redo > should override remotely added groups
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -10311,7 +10279,6 @@ exports[`history > multiplayer undo/redo > should override remotely added points
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -10656,7 +10623,6 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -10896,7 +10862,6 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -11350,7 +11315,6 @@ exports[`history > multiplayer undo/redo > should update history entries after r
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -11609,7 +11573,6 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -11853,7 +11816,6 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -12099,7 +12061,6 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -12505,7 +12466,6 @@ exports[`history > singleplayer undo/redo > should create new history entry on s
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -12757,7 +12717,6 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -13003,7 +12962,6 @@ exports[`history > singleplayer undo/redo > should end up with no history entry
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -13249,7 +13207,6 @@ exports[`history > singleplayer undo/redo > should iterate through the history w
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -13501,7 +13458,6 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -13838,7 +13794,6 @@ exports[`history > singleplayer undo/redo > should not collapse when applying co
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -14015,7 +13970,6 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -14308,7 +14262,6 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -14580,7 +14533,6 @@ exports[`history > singleplayer undo/redo > should not override appstate changes
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -14860,7 +14812,6 @@ exports[`history > singleplayer undo/redo > should support appstate name or view
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -15026,7 +14977,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -15725,7 +15675,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -16346,7 +16295,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -16967,7 +16915,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -17679,7 +17626,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -18428,7 +18374,6 @@ exports[`history > singleplayer undo/redo > should support changes in elements'
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -18907,7 +18852,6 @@ exports[`history > singleplayer undo/redo > should support duplication of groups
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -19434,7 +19378,6 @@ exports[`history > singleplayer undo/redo > should support element creation, del
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,
@ -19895,7 +19838,6 @@ exports[`history > singleplayer undo/redo > should support linear element creati
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"newElement": null,

View file

@ -60,7 +60,6 @@ exports[`given element A and group of elements B and given both are selected whe
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -477,7 +476,6 @@ exports[`given element A and group of elements B and given both are selected whe
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -885,7 +883,6 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -1432,7 +1429,6 @@ exports[`regression tests > Drags selected element when hitting only bounding bo
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -1638,7 +1634,6 @@ exports[`regression tests > adjusts z order when grouping > [end of test] appSta
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -2015,7 +2010,6 @@ exports[`regression tests > alt-drag duplicates an element > [end of test] appSt
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -2255,7 +2249,6 @@ exports[`regression tests > arrow keys > [end of test] appState 1`] = `
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -2437,7 +2430,6 @@ exports[`regression tests > can drag element that covers another element, while
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -2759,7 +2751,6 @@ exports[`regression tests > change the properties of a shape > [end of test] app
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -3007,7 +2998,6 @@ exports[`regression tests > click on an element and drag it > [dragged] appState
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -3252,7 +3242,6 @@ exports[`regression tests > click on an element and drag it > [end of test] appS
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -3484,7 +3473,6 @@ exports[`regression tests > click to select a shape > [end of test] appState 1`]
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -3742,7 +3730,6 @@ exports[`regression tests > click-drag to select a group > [end of test] appStat
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -4055,7 +4042,6 @@ exports[`regression tests > deleting last but one element in editing group shoul
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -4479,7 +4465,6 @@ exports[`regression tests > deselects group of selected elements on pointer down
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -4764,7 +4749,6 @@ exports[`regression tests > deselects group of selected elements on pointer up w
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -5019,7 +5003,6 @@ exports[`regression tests > deselects selected element on pointer down when poin
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -5231,7 +5214,6 @@ exports[`regression tests > deselects selected element, on pointer up, when clic
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -5432,7 +5414,6 @@ exports[`regression tests > double click to edit a group > [end of test] appStat
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -5816,7 +5797,6 @@ exports[`regression tests > drags selected elements from point inside common bou
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -6108,7 +6088,6 @@ exports[`regression tests > draw every type of shape > [end of test] appState 1`
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -6918,7 +6897,6 @@ exports[`regression tests > given a group of selected elements with an element t
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -7250,7 +7228,6 @@ exports[`regression tests > given a selected element A and a not selected elemen
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -7528,7 +7505,6 @@ exports[`regression tests > given selected element A with lower z-index than uns
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -7764,7 +7740,6 @@ exports[`regression tests > given selected element A with lower z-index than uns
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -8003,7 +7978,6 @@ exports[`regression tests > key 2 selects rectangle tool > [end of test] appStat
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -8185,7 +8159,6 @@ exports[`regression tests > key 3 selects diamond tool > [end of test] appState
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -8367,7 +8340,6 @@ exports[`regression tests > key 4 selects ellipse tool > [end of test] appState
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -8549,7 +8521,6 @@ exports[`regression tests > key 5 selects arrow tool > [end of test] appState 1`
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -8774,7 +8745,6 @@ exports[`regression tests > key 6 selects line tool > [end of test] appState 1`]
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -8998,7 +8968,6 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] appState
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -9194,7 +9163,6 @@ exports[`regression tests > key a selects arrow tool > [end of test] appState 1`
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -9419,7 +9387,6 @@ exports[`regression tests > key d selects diamond tool > [end of test] appState
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -9601,7 +9568,6 @@ exports[`regression tests > key l selects line tool > [end of test] appState 1`]
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -9825,7 +9791,6 @@ exports[`regression tests > key o selects ellipse tool > [end of test] appState
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -10007,7 +9972,6 @@ exports[`regression tests > key p selects freedraw tool > [end of test] appState
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -10203,7 +10167,6 @@ exports[`regression tests > key r selects rectangle tool > [end of test] appStat
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -10385,7 +10348,6 @@ exports[`regression tests > make a group and duplicate it > [end of test] appSta
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -10895,7 +10857,6 @@ exports[`regression tests > noop interaction after undo shouldn't create history
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -11174,7 +11135,6 @@ exports[`regression tests > pinch-to-zoom works > [end of test] appState 1`] = `
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "touch",
"multiElement": null,
"name": "Untitled-201933152653",
@ -11302,7 +11262,6 @@ exports[`regression tests > shift click on selected element should deselect it o
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -11503,7 +11462,6 @@ exports[`regression tests > shift-click to multiselect, then drag > [end of test
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -11816,7 +11774,6 @@ exports[`regression tests > should group elements and ungroup them > [end of tes
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -12230,7 +12187,6 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -12845,7 +12801,6 @@ exports[`regression tests > spacebar + drag scrolls the canvas > [end of test] a
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -12976,7 +12931,6 @@ exports[`regression tests > supports nested groups > [end of test] appState 1`]
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -13562,7 +13516,6 @@ exports[`regression tests > switches from group of selected elements to another
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -13902,7 +13855,6 @@ exports[`regression tests > switches selected element on pointer down > [end of
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -14169,7 +14121,6 @@ exports[`regression tests > two-finger scroll works > [end of test] appState 1`]
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "touch",
"multiElement": null,
"name": "Untitled-201933152653",
@ -14297,7 +14248,6 @@ exports[`regression tests > undo/redo drawing an element > [end of test] appStat
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -14678,7 +14628,6 @@ exports[`regression tests > updates fontSize & fontFamily appState > [end of tes
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",
@ -14806,7 +14755,6 @@ exports[`regression tests > zoom hotkeys > [end of test] appState 1`] = `
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "Untitled-201933152653",

View file

@ -1,5 +1,3 @@
import type { GlobalPoint } from "@excalidraw/math";
import type {
IMAGE_MIME_TYPES,
UserIdleState,
@ -214,7 +212,6 @@ export type InteractiveCanvasAppState = Readonly<
activeEmbeddable: AppState["activeEmbeddable"];
editingLinearElement: AppState["editingLinearElement"];
selectionElement: AppState["selectionElement"];
lassoSelection: AppState["lassoSelection"];
selectedGroupIds: AppState["selectedGroupIds"];
selectedLinearElement: AppState["selectedLinearElement"];
multiElement: AppState["multiElement"];
@ -288,9 +285,6 @@ export interface AppState {
* - set on pointer down, updated during pointer move
*/
selectionElement: NonDeletedExcalidrawElement | null;
lassoSelection: {
points: readonly GlobalPoint[];
} | null;
isBindingEnabled: boolean;
startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
suggestedBindings: SuggestedBinding[];

View file

@ -60,7 +60,6 @@ exports[`exportToSvg > with default arguments 1`] = `
"isLoading": false,
"isResizing": false,
"isRotating": false,
"lassoSelection": null,
"lastPointerDownWith": "mouse",
"multiElement": null,
"name": "name",