Fix autofit for texts with different number of lines