Precise collision detection with the border