From 73a45e19889de08be64faf2cdddae2b9ecaa1a20 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Fri, 16 Dec 2022 18:19:26 +0100 Subject: [PATCH] fix: not properly restoring element stroke and bg colors (#6002) --- src/data/restore.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/restore.ts b/src/data/restore.ts index ff870153..be33b7f2 100644 --- a/src/data/restore.ts +++ b/src/data/restore.ts @@ -33,6 +33,7 @@ import { LinearElementEditor } from "../element/linearElementEditor"; import { bumpVersion } from "../element/mutateElement"; import { getUpdatedTimestamp, updateActiveTool } from "../utils"; import { arrayToMap } from "../utils"; +import oc from "open-color"; type RestoredAppState = Omit< AppState, @@ -110,8 +111,8 @@ const restoreElementWithProperties = < angle: element.angle || 0, x: extra.x ?? element.x ?? 0, y: extra.y ?? element.y ?? 0, - strokeColor: element.strokeColor, - backgroundColor: element.backgroundColor, + strokeColor: element.strokeColor || oc.black, + backgroundColor: element.backgroundColor || "transparent", width: element.width || 0, height: element.height || 0, seed: element.seed ?? 1,