Returns true if the point given by the x and y coordinates passed to the method, when treated as coordinates in the canvas coordinate space unaffected by the current transformation, is inside the intended path as determined by the non-zero winding number rule; returns false otherwise. If either of the arguments is infinite or NaN, then the method returns false.
Method of apis/canvas/CanvasRenderingContext2Dapis/canvas/CanvasRenderingContext2D
Syntaxvar object = object.isPointInPath(x, y);
Parameters x
The x-coordinate to test.
yThe y-coordinate to test.
Return ValueReturns an object of type DOM NodeDOM Node
Type: VARIANT_BOOL
This method can return one of these values.
Return value Description false The point is not in the current path. true The point is in the current path. ExamplesThis example simply tests whether a given point is in the current path (the previously defined rectangle) and alerts true or false.
<canvas id="myCanvas" width="300" height="150" style="border:1px solid blue;"></canvas>
<p>. . .</p>
<script>
var can = document.getElementById("myCanvas");
var ctxt = can.getContext("2d");
ctxt.rect(20, 20, 150, 100);
alert(ctxt.isPointInPath(30,50));
</script>
Related specifications
Microsoft Developer Network: Windows Internet Explorer API reference Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4