fix auto bbox calculation in in top-to-bottom writing direction