fix drawing off the edge