Here are some functions to fit objects within a view using a few lines of trigonometry math:
You could tweak those functions to operate on half of the view instead of the full view.
Here are some functions to fit objects within a view using a few lines of trigonometry math:
You could tweak those functions to operate on half of the view instead of the full view.