take max number of lines into account when calculating textbox size