mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix
This commit is contained in:
parent
016662a7f6
commit
f57e72443d
2 changed files with 13 additions and 1 deletions
|
@ -102,7 +102,6 @@ export const restoreElementWithProperties = <
|
||||||
> &
|
> &
|
||||||
Partial<Pick<ExcalidrawElement, "type" | "x" | "y">>,
|
Partial<Pick<ExcalidrawElement, "type" | "x" | "y">>,
|
||||||
): T => {
|
): T => {
|
||||||
console.log("ELEMENT", element.backgroundColor);
|
|
||||||
const base: Pick<T, keyof ExcalidrawElement> & {
|
const base: Pick<T, keyof ExcalidrawElement> & {
|
||||||
[PRECEDING_ELEMENT_KEY]?: string;
|
[PRECEDING_ELEMENT_KEY]?: string;
|
||||||
} = {
|
} = {
|
||||||
|
|
|
@ -333,6 +333,19 @@ export const convertToExcalidrawElements = (
|
||||||
if (endBoundElement && !elementWithid?.end?.id) {
|
if (endBoundElement && !elementWithid?.end?.id) {
|
||||||
excalidrawElements.push(endBoundElement);
|
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 {
|
} else {
|
||||||
excalidrawElement = {
|
excalidrawElement = {
|
||||||
...elementWithid,
|
...elementWithid,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue