Skip to content

Instantly share code, notes, and snippets.

@jimib
Created October 31, 2020 10:44
Show Gist options
  • Save jimib/3b5b5fe50713dd92c51ebe9d5fe549f3 to your computer and use it in GitHub Desktop.
Save jimib/3b5b5fe50713dd92c51ebe9d5fe549f3 to your computer and use it in GitHub Desktop.
Display size
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