Created
October 31, 2020 10:44
-
-
Save jimib/3b5b5fe50713dd92c51ebe9d5fe549f3 to your computer and use it in GitHub Desktop.
Display size
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
var heightPx = 512; | |
var widthPx = 512; | |
var sizePx = Math.max( widthPx, heightPx ); | |
var targetSize = 0.5; | |
var scaleX = targetSize * widthPx / sizePx; | |
var scaleY = targetSize * heightPx / sizePx; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment