use a better cloning algorithm (#753)

* use a better cloning algorithm

* Revert "use a better cloning algorithm"

This reverts commit 7279262129.

* implement custom cloning algorithm

* add tests

* refactor

* don't copy canvas & ignore canvas in related ops

* fix tests
This commit is contained in:
David Luzar 2020-02-19 22:28:11 +01:00 committed by GitHub
parent 5256096d76
commit 9439908b92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 118 additions and 11 deletions

View file

@ -13,7 +13,7 @@ class SceneHistory {
) {
return JSON.stringify({
appState: clearAppStatePropertiesForHistory(appState),
elements: elements.map(({ shape, ...element }) => ({
elements: elements.map(({ shape, canvas, ...element }) => ({
...element,
shape: null,
canvas: null,