refactor
This commit is contained in:
parent
f832bf9fde
commit
6d6b958f27
@ -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;
|
||||
|
||||
@ -424,8 +424,11 @@ export const toggleLinePolygonState = (
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
// TODO: satisfies ElementUpdate<ExcalidrawLineElement>
|
||||
const ret = {
|
||||
loopLock: nextPolygonState,
|
||||
points: updatedPoints,
|
||||
};
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
@ -340,8 +340,8 @@ const restoreElement = (
|
||||
points,
|
||||
x,
|
||||
y,
|
||||
...(isLineElement(element) && element.loopLock === undefined
|
||||
? { loopLock: false }
|
||||
...(isLineElement(element)
|
||||
? { loopLock: element.loopLock ?? false }
|
||||
: {}),
|
||||
...getSizeFromPoints(points),
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user