added overflow checking for text coordinates.