Improved resize feature to comply with new text elements.