Scale the content size to the specified aspect ratio depending on the container dimensions