Added more efficient method for checking already-drawn edge.