Do not deep clone before serializing.
This was ok when we did not attach assets, but it is not cool now. With large assets, this made saving extremely slow
This commit is contained in:
1 parent
ad6f15bfa1
commit
fd2723ff7d
1 file changed
+1
-2
@@ -14,7 +14,6 @@ const StageLayering = require('../engine/stage-layering');
|
||||
const log = require('../util/log');
|
||||
const uid = require('../util/uid');
|
||||
const MathUtil = require('../util/math-util');
|
||||
const StringUtil = require('../util/string-util');
|
||||
|
||||
const {loadCostume} = require('../import/load-costume.js');
|
||||
const {loadSound} = require('../import/load-sound.js');
|
||||
@@ -521,7 +520,7 @@ const serialize = function (runtime, targetId) {
|
||||
|
||||
const layerOrdering = getSimplifiedLayerOrdering(originalTargetsToSerialize);
|
||||
|
||||
const flattenedOriginalTargets = JSON.parse(StringUtil.stringify(originalTargetsToSerialize));
|
||||
const flattenedOriginalTargets = originalTargetsToSerialize.map(t => t.toJSON());
|
||||
|
||||
// If the renderer is attached, and we're serializing a whole project (not a sprite)
|
||||
// add a temporary layerOrder property to each target.
|
||||
|
||||
Reference in new issue
Block a user