Skip to content

Commit

Permalink
update transformControls on camera change
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Aug 31, 2024
1 parent 2118c10 commit 93f7b20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/editor/lib/EditorControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ THREE.EditorControls = function (_object, domElement) {
scope.transitionSpeed = 0.001;
scope.transitionProgress = 0;
scope.transitioning = true;
// The changeEvent is emitted at the end of the transition below
};

function easeInOutQuad(t) {
Expand Down Expand Up @@ -138,8 +137,8 @@ THREE.EditorControls = function (_object, domElement) {
this.transitioning = false;
object.position.copy(this.transitionCamPosEnd);
object.quaternion.copy(this.transitionCamQuaternionEnd);
scope.dispatchEvent(changeEvent);
}
scope.dispatchEvent(changeEvent);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/editor/lib/viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export function Viewport(inspector) {
controls.zoomSpeed = 0.05;
controls.setAspectRatio(sceneEl.canvas.width / sceneEl.canvas.height);
controls.addEventListener('change', () => {
transformControls.update(true); // true is updateScale
Events.emit('camerachanged');
});

Expand Down Expand Up @@ -291,7 +292,6 @@ export function Viewport(inspector) {

Events.on('objectfocus', (object) => {
controls.focus(object);
transformControls.update();
});

Events.on('geometrychanged', (object) => {
Expand Down

0 comments on commit 93f7b20

Please sign in to comment.