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,