Skip to content

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
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.

4 participants