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