Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/systems/brush.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ AFRAME.registerSystem('brush', {
console.timeEnd('Binary Loading');
},
loadFromUrl: function (url, binary) {
var loader = new THREE.XHRLoader(this.manager);
var loader = new THREE.FileLoader(this.manager);
loader.crossOrigin = 'anonymous';
if (binary === true) {
loader.setResponseType('arraybuffer');
Expand Down
13 changes: 6 additions & 7 deletions src/systems/painter.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,12 @@ AFRAME.registerSystem('painter', {
if (urlParams.url || urlParams.urljson) {
var isBinary = urlParams.urljson === undefined;
this.brushSystem.loadFromUrl(urlParams.url || urlParams.urljson, isBinary);
document.getElementById('logo').setAttribute('visible', false);
document.getElementById('acamera').setAttribute('orbit-controls', 'initialPosition: 0 1.6 3');
document.getElementById('apainter-logo').classList.remove('hidden');
//document.getElementById('apainter-author').classList.remove('hidden'); // not used yet
} else { // No painting to load, move camera in front of logo
const cameraEl = document.getElementById('acamera')
cameraEl.setAttribute('position', '0 1.6 0');
document.addEventListener('DOMContentLoaded', e => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is strange. This logic is in the init method. It shouldn't run before the DOM is ready. Maybe I'm not fully understanding

document.getElementById('logo').setAttribute('visible', false);
document.getElementById('acamera').setAttribute('position', '0 1.6 3');
document.getElementById('apainter-logo').classList.remove('hidden');
//document.getElementById('apainter-author').classList.remove('hidden'); // not used yet
});
}

if (urlParams.bgcolor !== undefined) {
Expand Down