ctx.rect(10, 10, 100, 100); ctx.stroke(); console.log(ctx.isPointInPath(10, 10)); // true