fix: merge issue and forgotten debug

This commit is contained in:
dwelle 2025-05-25 23:12:20 +02:00
parent 23cf5fb475
commit 2d6469a695
2 changed files with 6 additions and 6 deletions

View File

@ -178,13 +178,13 @@ export const actionFinalize = register({
newElements = newElements.filter((el) => el.id !== element!.id); 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, // If the multi point line closes the loop,
// set the last point to first point. // set the last point to first point.
// This ensures that loop remains closed at different scales. // This ensures that loop remains closed at different scales.
const isLoop = isPathALoop(element.points, appState.zoom.value); const isLoop = isPathALoop(element.points, appState.zoom.value);
if (isLoop) { if (isLoop && (isLineElement(element) || isFreeDrawElement(element))) {
const linePoints = element.points; const linePoints = element.points;
const firstPoint = linePoints[0]; const firstPoint = linePoints[0];
const points: LocalPoint[] = linePoints.map((p, index) => const points: LocalPoint[] = linePoints.map((p, index) =>

View File

@ -586,10 +586,10 @@ function CommandPaletteInner({
}); });
setAllCommands(allCommands); setAllCommands(allCommands);
// setLastUsed( setLastUsed(
// allCommands.find((command) => command.label === lastUsed?.label) ?? allCommands.find((command) => command.label === lastUsed?.label) ??
// null, null,
// ); );
} }
}, [ }, [
stableDeps, stableDeps,