Moved menu size calculation into rendering functions