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

WebGLRenderer: Use ES6 default parameter in setSize(). #25486

Merged
merged 2 commits into from
Feb 15, 2023

Conversation

linbingquan
Copy link
Contributor

Related issue: #XXXX

Description

As the title.

@epreston
Copy link
Contributor

epreston commented Feb 12, 2023

Wouldn't the default value be false if its not provided ? This changes the default to true to optimise an "if" statement.

@gkjohnson
Copy link
Collaborator

gkjohnson commented Feb 12, 2023

Wouldn't the default value be false if its not provided ?

The current default is undefined which amounts to true since undefined !== false when evaluating with triple equals.

@epreston
Copy link
Contributor

Oh wow.. that is hairy. Worth a cleanup to make it readable. 😄

@Mugen87 Mugen87 added this to the r150 milestone Feb 12, 2023
@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 15, 2023

BTW: We are already using the PR's approach in WebGPURenderer.setSize() and the other renderers do not have a updateStyle parameter.

@Mugen87 Mugen87 merged commit 742b033 into mrdoob:dev Feb 15, 2023
@Mugen87 Mugen87 changed the title WebGLRenderer: use ES6 default value for setSize WebGLRenderer: Use ES6 default parameter in setSize(). Feb 15, 2023
@linbingquan linbingquan deleted the dev-webgl-renderer branch August 19, 2023 11:15
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

4 participants