Rework resizing and text box annotations. Fixes #2132

Change-Id: I1f48471df321c23800309aa3088d440ac2643e7a