diff --git a/packages/excalidraw/actions/actionFinalize.tsx b/packages/excalidraw/actions/actionFinalize.tsx index e1c044f1e..cd3960a53 100644 --- a/packages/excalidraw/actions/actionFinalize.tsx +++ b/packages/excalidraw/actions/actionFinalize.tsx @@ -178,13 +178,13 @@ export const actionFinalize = register({ newElements = newElements.filter((el) => el.id !== element!.id); } - if (isLineElement(element) || isFreeDrawElement(element)) { + if (isLinearElement(element) || isFreeDrawElement(element)) { // If the multi point line closes the loop, // set the last point to first point. // This ensures that loop remains closed at different scales. const isLoop = isPathALoop(element.points, appState.zoom.value); - if (isLoop) { + if (isLoop && (isLineElement(element) || isFreeDrawElement(element))) { const linePoints = element.points; const firstPoint = linePoints[0]; const points: LocalPoint[] = linePoints.map((p, index) => diff --git a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx index 836889b41..b0fc5e7ee 100644 --- a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx +++ b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx @@ -586,10 +586,10 @@ function CommandPaletteInner({ }); setAllCommands(allCommands); - // setLastUsed( - // allCommands.find((command) => command.label === lastUsed?.label) ?? - // null, - // ); + setLastUsed( + allCommands.find((command) => command.label === lastUsed?.label) ?? + null, + ); } }, [ stableDeps,