Fixed adjust text box algorithm