Prevent clearrect wrapping round at the edge of the screen