Handle resizing and get the scale more efficiently