Fix rendering bug when width becomes too wide

A different, more general fix went into upstream, but in my testing
there were rendering artifacts under Chrome 27.0.1453.93 beta.