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);
}
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) =>

View File

@ -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,