Skip to content

Commit

Permalink
Properly call setAttribute for position, rotation, scale when modifyi…
Browse files Browse the repository at this point in the history
…ng with the TransformControls, so that entity.flushToDOM() works correctly when duplicating an entity (fix aframevr#688)
  • Loading branch information
vincentfretin committed Jul 23, 2023
1 parent 72fd461 commit 0d6a7d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ export function Viewport(inspector) {
component = 'scale';
value = `${object.scale.x} ${object.scale.y} ${object.scale.z}`;
}

// We need to call setAttribute for component attrValue to be up to date,
// so that entity.flushToDOM() works correctly when duplicating an entity.
transformControls.object.el.setAttribute(component, value);

Events.emit('entityupdate', {
component: component,
entity: transformControls.object.el,
Expand Down

0 comments on commit 0d6a7d3

Please sign in to comment.