Fixed calculation of button y-positions