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

Manual: Refactor canvas width and height computation. #27606

Merged
merged 4 commits into from Jan 23, 2024

Conversation

herobank110
Copy link
Contributor

Description

I think the examples should say device pixel ratio OR 1, instead of OR 0, then it would get a zero size

@gkjohnson
Copy link
Collaborator

gkjohnson commented Jan 22, 2024

These are bitwise operators, not boolean or operations. The operation effectively just truncates to an integer. Using 1 is incorrect. It would probably be best to use a more clear function for this, though.

@mrdoob
Copy link
Owner

mrdoob commented Jan 22, 2024

Maybe we should use Math.floor() to avoid confusing people?

@herobank110
Copy link
Contributor Author

Oh, I see. I have changed the code to Math.floor.

@Mugen87 Mugen87 changed the title Device-pixel-ratio-times-one Manual: Refactor canvas width and height computation. Jan 22, 2024
@WestLangley WestLangley added this to the r161 milestone Jan 22, 2024
@mrdoob mrdoob merged commit 6d5140a into mrdoob:dev Jan 23, 2024
11 checks passed
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