-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
Conversation
@@ -961,13 +959,13 @@ THREE.OrbitControls = function ( object, domElement ) { | |||
|
|||
function onMouseUp( event ) { | |||
|
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
Seems simpler indeed 👌 |
Thanks! |
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