Adjusts the height of the box when the width changes to keep the proportions the same.