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)) { if (isLineElement(element)) {
return { const lineElement: NonDeleted<ExcalidrawLineElement> = {
...element, ...element,
loopLock: false, loopLock: false,
} as NonDeleted<ExcalidrawLineElement>; };
return lineElement;
} }
return element; return element;

View File

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

View File

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