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

ArcballControls: Fix code style. #25182

Merged
merged 1 commit into from
Dec 23, 2022
Merged

ArcballControls: Fix code style. #25182

merged 1 commit into from
Dec 23, 2022

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Dec 23, 2022

Related issue: -

Description

ArcballControls does some strange method definitions inside its class. They look like so:

onPointerCancel = () => {

    this._touchStart.splice( 0, this._touchStart.length );
    this._touchCurrent.splice( 0, this._touchCurrent.length );
    this._input = INPUT.NONE;

};

The class does this so it can directly use the method for an event listener (to retain the this reference). However, the same pattern is applied to methods which are not intended as event listeners. This is actually breaks eslint on my system and I think it's also confusing to use arrow functions like that.

Event listeners are now normal functions like in other controls and the above pattern is completely removed from the class.

@Mugen87 Mugen87 added this to the r149 milestone Dec 23, 2022
@Mugen87 Mugen87 merged commit c9ec6f3 into mrdoob:dev Dec 23, 2022
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.

1 participant