This commit is contained in:
Aakansha Doshi 2023-05-29 14:08:55 +05:30
parent 016662a7f6
commit f57e72443d
2 changed files with 13 additions and 1 deletions

View file

@ -102,7 +102,6 @@ export const restoreElementWithProperties = <
> &
Partial<Pick<ExcalidrawElement, "type" | "x" | "y">>,
): T => {
console.log("ELEMENT", element.backgroundColor);
const base: Pick<T, keyof ExcalidrawElement> & {
[PRECEDING_ELEMENT_KEY]?: string;
} = {

View file

@ -333,6 +333,19 @@ export const convertToExcalidrawElements = (
if (endBoundElement && !elementWithid?.end?.id) {
excalidrawElements.push(endBoundElement);
}
} else if (elementWithid.type === "line") {
const width = elementWithid.width || 300;
const height = elementWithid.height || 0;
const lineElement = newLinearElement({
width,
height,
points: [
[0, 0],
[width, height],
],
...elementWithid,
});
excalidrawElements.push(lineElement);
} else {
excalidrawElement = {
...elementWithid,