Skip to content

Commit

Permalink
fix small issues seen in demo apps
Browse files Browse the repository at this point in the history
- viewer.setDimensions already before viewer.init, in constructor - in that case don't render
- bimserverviewer revision handling
  • Loading branch information
hlg committed Jan 12, 2023
1 parent 3709e49 commit c92ef2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
16 changes: 2 additions & 14 deletions viewer/bimserverviewer.js
Expand Up @@ -28,19 +28,7 @@ export class BimServerViewer extends AbstractViewer {
}

loadRevisionByRoid(api, roid) {
return new Promise((resolve, reject) => {
api.call("ServiceInterface", "listBoundingBoxes", {
roids: [roid]
}, (bbs) => {
if (bbs.length > 1) {
this.settings.regionSelector(bbs).then((bb) => {
this.genDensityThreshold(api, [roid], bb).then(resolve);
});
} else {
this.genDensityThreshold(api, [roid], bbs[0]).then(resolve);
}
});
});
return this.loadRevisionsByRoids(api, [roid]);
}

unloadRevisionByRoid(roid) {
Expand Down Expand Up @@ -75,7 +63,7 @@ export class BimServerViewer extends AbstractViewer {
}

loadRevision(api, revision) {
this.loadRevisionByRoid(api, revision.oid);
return this.loadRevisionByRoid(api, revision.oid);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion viewer/viewer.js
Expand Up @@ -490,7 +490,7 @@ export class Viewer {
this.camera.forceBuild();
this.updateViewport();
this.overlay.resize();
this.render();
if(this.running) this.render();
}

render(now) {
Expand Down

0 comments on commit c92ef2d

Please sign in to comment.