Skip to content

Commit

Permalink
feat: do not strip unknown element properties on restore (excalidraw#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle authored Oct 21, 2024
1 parent e957c8e commit 4cedf3d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 147 deletions.
4 changes: 4 additions & 0 deletions packages/excalidraw/data/restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ const restoreElementWithProperties = <
}

return {
// spread the original element properties to not lose unknown ones
// for forward-compatibility
...element,
// normalized properties
...base,
...getNormalizedDimensions(base),
...extra,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ exports[`restoreElements > should restore text element correctly with unknown fo
"containerId": null,
"customData": undefined,
"fillStyle": "solid",
"font": "10 unknown",
"fontFamily": 5,
"fontSize": 10,
"frameId": null,
Expand Down
Loading

0 comments on commit 4cedf3d

Please sign in to comment.