Skip to content

Instantly share code, notes, and snippets.

@AndriyBas
Created November 9, 2016 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndriyBas/abffbf06b8ba91d2f4303164d71eed57 to your computer and use it in GitHub Desktop.
Save AndriyBas/abffbf06b8ba91d2f4303164d71eed57 to your computer and use it in GitHub Desktop.
how to calculate the holy scale
float widthAspect = 1.0F * canvasWidth / width;
float heightAspect = 1.0F * canvasHeight / height;
// fit the smallest size
holyScale = Math.min(widthAspect, heightAspect);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment