Draw a rectangle if the point 20,50 is in the current path:
JavaScript:
Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the isPointInPath() method.
Note: Internet Explorer 8 and earlier versions, do not support the <canvas> element.
The isPointInPath() method returns true if the specified point is in the current path, otherwise false.
JavaScript syntax: | context.isPointInPath(x,y); |
---|
Parameter | Description |
---|---|
x | The x-coordinate to test |
y | The y-coordinate to test |