Don't serialize layerOrder when exporting a sprite.

This commit is contained in:
Karishma Chadha 2018-07-24 16:11:18 -04:00
parent ac550d2d38
commit 53ccb8d709

View file

@ -485,7 +485,9 @@ const serialize = function (runtime, targetId) {
const flattenedOriginalTargets = JSON.parse(JSON.stringify(originalTargetsToSerialize));
if (runtime.renderer) {
// If the renderer is attached, and we're serializing a whole project (not a sprite)
// add a temporary layerOrder property to each target.
if (runtime.renderer && !targetId) {
flattenedOriginalTargets.forEach((t, index) => {
t.layerOrder = layerOrdering[index];
});