diff --git a/src/data/restore.ts b/src/data/restore.ts index 580205611..2e7e0ac52 100644 --- a/src/data/restore.ts +++ b/src/data/restore.ts @@ -195,7 +195,9 @@ const restoreElement = ( }); } case "custom": - return restoreElementWithProperties(element, { customType: "custom" }); + return restoreElementWithProperties(element, { + customType: element.customType || "custom", + }); // generic elements case "ellipse": return restoreElementWithProperties(element, {}); diff --git a/src/packages/excalidraw/example/initialData.js b/src/packages/excalidraw/example/initialData.js index dde22b83b..b37bafb05 100644 --- a/src/packages/excalidraw/example/initialData.js +++ b/src/packages/excalidraw/example/initialData.js @@ -69,6 +69,32 @@ export default { status: "pending", scale: [1, 1], }, + { + id: "z35XgE9DvTXlG1OzXmp2x", + type: "custom", + x: 147.13928993437958, + y: 328.8974609375, + width: 60, + height: 60, + angle: 0, + strokeColor: "#000000", + backgroundColor: "transparent", + fillStyle: "hachure", + strokeWidth: 1, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + strokeSharpness: "round", + seed: 1483808630, + version: 79, + versionNonce: 861014250, + isDeleted: false, + boundElements: null, + updated: 1648630123004, + link: null, + customType: "star", + }, ], appState: { viewBackgroundColor: "#AFEEEE", currentItemFontFamily: 1 }, scrollToContent: true,