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