range checking on draw pixel