Fix bug in which initially painted text was positioned incorrectly.