Better precision for detecting points in rectangle