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

OrbitControls: Fixed sticky controls when disabled. #20735

Merged
merged 1 commit into from
Nov 22, 2020
Merged

OrbitControls: Fixed sticky controls when disabled. #20735

merged 1 commit into from
Nov 22, 2020

Conversation

arodic
Copy link
Sponsor Contributor

@arodic arodic commented Nov 22, 2020

Alternative solution to #20380

I found this simple fix worked in my case. It does not to anything fancy, only allows pointerUp to to remove pointermove listeners even when the controls are disabled. @gkjohnson

@@ -961,13 +959,13 @@ THREE.OrbitControls = function ( object, domElement ) {

function onMouseUp( event ) {

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

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

Prevents "stickiness" by removing "pointerup" and "pointermove" even if controls are disabled mid-gesture.

@@ -800,8 +800,6 @@ THREE.OrbitControls = function ( object, domElement ) {

function onPointerUp( event ) {

if ( scope.enabled === false ) return;
Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

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

This event is forwarded to onMouseUp that also has the same statement.

@mrdoob
Copy link
Owner

mrdoob commented Nov 22, 2020

Seems simpler indeed 👌
@gkjohnson does this solve your use case?

@mrdoob mrdoob added this to the r123 milestone Nov 22, 2020
@gkjohnson
Copy link
Collaborator

@mrdoob Yes I believe this should fix it, as well. I just tested it and the sticky behavior is gone in the examples.

Thanks @arodic!

@mrdoob mrdoob changed the title Fixed sticky orbit controlls when disabled. OrbitControls: Fixed sticky controlls when disabled. Nov 22, 2020
@mrdoob mrdoob merged commit 5e46e96 into mrdoob:dev Nov 22, 2020
@mrdoob
Copy link
Owner

mrdoob commented Nov 22, 2020

Thanks!

@Mugen87 Mugen87 changed the title OrbitControls: Fixed sticky controlls when disabled. OrbitControls: Fixed sticky controls when disabled. Nov 25, 2020
@arodic arodic deleted the OrbitControls-sticky-disabled-fix branch April 19, 2022 06:54
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.

None yet

3 participants