Skip to content

Commit

Permalink
fix(stats): update initial position of stats when opened
Browse files Browse the repository at this point in the history
  • Loading branch information
mwfarb committed Aug 25, 2022
1 parent 2eec88e commit 6dbebe2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/arena-camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ AFRAME.registerComponent('arena-camera', {
const data = this.data;
if (oldData.showStats !== data.showStats) {
document.getElementById('pose-stats').style.display = (data.showStats) ? 'block' : 'none';
if (this.data.showStats) { // update initial position of stats when opened
document.getElementById('pose-stats').textContent =
`Position: ${ARENAUtils.coordsToText(data.position)}\r\nRotation: ${ARENAUtils.rotToText(data.rotation)}`;
}
}
},
/**
Expand Down

0 comments on commit 6dbebe2

Please sign in to comment.