Replace anonymous function in Text.updateSize()