Skip to content

Commit

Permalink
Don't export position/rotation/scale/visible if it's the empty value (f…
Browse files Browse the repository at this point in the history
…ix #763)
  • Loading branch information
vincentfretin committed Sep 7, 2024
1 parent fb68ae9 commit 3536987
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,17 @@ function optimizeComponents(copy, source) {
var value = stringifyComponentValue(schema, optimalUpdate);
setAttribute.call(copy, name, value);
}

// Remove special components if they use the default value
if (
value === '' &&
(name === 'visible' ||
name === 'position' ||
name === 'rotation' ||
name === 'scale')
) {
removeAttribute.call(copy, name);
}
});
}

Expand Down

0 comments on commit 3536987

Please sign in to comment.