layout: Refactor `InlineFlow::assign_height` to pull out horizontal
position calculation into a separate function.