Remove layerOrder property, sprites are rendered in the order the targets are listed in in the .sb2 file.

This commit is contained in:
Karishma Chadha 2018-07-23 15:48:27 -04:00
parent 2508dc46ca
commit b3ee2c439d

View file

@ -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);