Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Middle Click Drag for Environment Control #789

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jo-chemla
Copy link
Contributor

Following issue #788
Handle Middle Click Drag for Environment Control

Handle Middle Click Drag for Environment Control
Comment on lines 407 to 410
// use LOG to scale the scroll delta and hopefully normalize them across platforms
const deltaSign = Math.sign( delta );
const normalizedDelta = Math.log( Math.abs( delta ) + 1 );
this.zoomDelta -= 3 * deltaSign * normalizedDelta * 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Log scale shouldn't be needed if we're moving in screen space. It's used because the reported wheel "scroll" has pretty severely different magnitudes depending on platform.

+ these two calls are not necessary:
```js
// this._updateZoomDirection();
// this.needsUpdate = true;
```
@gkjohnson
Copy link
Contributor

Just got back home and tested it with a mouse - as you allude to in #788, I'm seeing that the drag point shifts as you move the mouse around. This is probably because the "zoom direction" is getting reset in different conditions. Like when the pointer moves and the ellipsoid frame has been rotated.

These are both cases that are valid when using pinch-to-zoom on mobile, though (since you may move your fingers around to zoom to different spots) so we'll need to be careful to not break that case when addressing regenerating the zoom direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants