Skip to content

Commit

Permalink
fix(PlanarControls): prevent freezing zoom when clicking while zoomin…
Browse files Browse the repository at this point in the history
…g with an orthographic camera
  • Loading branch information
mgermerie authored and gchoqueux committed Apr 19, 2021
1 parent fcc16da commit b0f0a2d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Controls/PlanarControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,13 @@ class PlanarControls extends THREE.EventDispatcher {
onMouseUp(event) {
event.preventDefault();

if (STATE.TRAVEL !== this.state && currentPressedButton === event.button) {
// Does not interrupt ongoing camera action if state is TRAVEL or CAMERA_OTHO. This prevents interrupting a zoom
// movement or a smart travel by pressing any movement key.
// The camera action is also uninterrupted if the released button does not match the button triggering the
// ongoing action. This prevents for instance exiting drag mode when right-clicking while dragging the view.
if (STATE.TRAVEL !== this.state
&& STATE.ORTHO_ZOOM !== this.state
&& currentPressedButton === event.button) {
this.state = STATE.NONE;
}

Expand Down

0 comments on commit b0f0a2d

Please sign in to comment.