I am trying to determine if a point is inside a path. I tryed Raphael JS, but as you can see in the Codepen bellow, it says that the point is not inside the path. I read that to determine if a point is in path, usually the nonzero or evenodd is use, but that does not check every area inside the path. I want a method to check every for every area that is covered by the path. The answer could be canvas, or SVG, as long as it works in all browsers it is fine for me.
var paper = Raphael(0, 0, 600, 600);
var p = paper.path("M222,218 L190,174 L203,152 L303,178 L259,216 L187,289 L161,304 L155,237 L215,197 L332,199 L325,164 L239,173 L192,233 L272,294 L351,265 L324,198 L269,199 L200,247 L212,292 L322,309 L366,266 L337,229 L260,249 L192,321 L169,324 L129,249 L131,201 L242,267 L308,294 L356,270 L364,230 L363,216 L222,218 Z");
p.attr('class','cursor');
var arr = [180,250];
var circle = paper.circle(arr[0], arr[1], 1);
console.log(p.isPointInside(arr[0],arr[1])); // returns false, but when I draw a circle at that point, it is clearly inside the path.