Created
June 17, 2019 22:14
-
-
Save AlainBarrios/f1c7ee958c0eb4304787eded726b3718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const imageRatio = texture.width / texture.height; | |
const canvasRatio = innerWidth / innerHeight; | |
const aspecRatio = | |
canvasRatio > imageRatio | |
? [1, imageRatio / canvasRatio] | |
: [canvasRatio / imageRatio, 1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment