Fix top-to-bottom layout x-coord calculation