This commit is contained in:
dwelle 2025-05-07 22:59:38 +02:00
parent f832bf9fde
commit 6d6b958f27
3 changed files with 10 additions and 5 deletions

View File

@ -473,10 +473,12 @@ export const newLinearElement = (
};
if (isLineElement(element)) {
return {
const lineElement: NonDeleted<ExcalidrawLineElement> = {
...element,
loopLock: false,
} as NonDeleted<ExcalidrawLineElement>;
};
return lineElement;
}
return element;

View File

@ -424,8 +424,11 @@ export const toggleLinePolygonState = (
}
}
return {
// TODO: satisfies ElementUpdate<ExcalidrawLineElement>
const ret = {
loopLock: nextPolygonState,
points: updatedPoints,
};
return ret;
};

View File

@ -340,8 +340,8 @@ const restoreElement = (
points,
x,
y,
...(isLineElement(element) && element.loopLock === undefined
? { loopLock: false }
...(isLineElement(element)
? { loopLock: element.loopLock ?? false }
: {}),
...getSizeFromPoints(points),
});