From b3ee2c439da2ecb90ea4abcfab320cd5ba5605c4 Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Mon, 23 Jul 2018 15:48:27 -0400 Subject: [PATCH] Remove layerOrder property, sprites are rendered in the order the targets are listed in in the .sb2 file. --- src/serialization/sb2.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/serialization/sb2.js b/src/serialization/sb2.js index be1abec22..27cd0c042 100644 --- a/src/serialization/sb2.js +++ b/src/serialization/sb2.js @@ -660,11 +660,7 @@ const parseScratchObject = function (object, runtime, extensions, topLevel, zip) const reorderParsedTargets = function (targets) { // Reorder parsed targets based on the temporary targetPaneOrder property - // and also create a layerOrder property to track the sprite's layer ordering. - - targets.forEach((t, index) => { - t.layerOrder = index; - }); + // and then delete it. targets.sort((a, b) => a.targetPaneOrder - b.targetPaneOrder);