Skip to content

Commit

Permalink
ensure center is set as target for preset buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhard-42 committed Jul 5, 2023
1 parent 14e30c7 commit 070c157
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ class Viewer {
* @param {boolean} [notify=true] - whether to send notification or not.
*/
presetCamera = (dir, zoom = null, notify = true) => {
this.camera.target = new THREE.Vector3(...this.bbox.center());
this.camera.presetCamera(dir, zoom, notify);
this.controls.setTarget(this.camera.target);
this.update(true, notify);
Expand Down

0 comments on commit 070c157

Please sign in to comment.