chang.shu@nokia.com | d5cb910 | 2010-05-21 20:47:13 +0000 | [diff] [blame^] | 1 | <!DOCTYPE html> |
| 2 | <title>Canvas test: 2d.path.isPointInPath.edge</title> |
| 3 | <script src="../tests.js"></script> |
| 4 | <link rel="stylesheet" href="../tests.css"> |
| 5 | <link rel="prev" href="2d.path.isPointInPath.basic.2.html" title="2d.path.isPointInPath.basic.2"> |
| 6 | <link rel="next" href="2d.path.isPointInPath.empty.html" title="2d.path.isPointInPath.empty"> |
| 7 | <body class="show_output"> |
| 8 | <p> |
| 9 | <a href="2d.path.isPointInPath.basic.2.html" accesskey="p" title="[p] 2d.path.isPointInPath.basic.2"><</a> |
| 10 | <a href="index.html">[index]</a> |
| 11 | <a href="2d.path.isPointInPath.empty.html" accesskey="n" title="[n] 2d.path.isPointInPath.empty">></a> |
| 12 | <h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.edge</h1> |
| 13 | <p class="desc">isPointInPath() counts points on the path as being inside</p> |
| 14 | <div class="refs">References: |
| 15 | <ul> |
| 16 | <li><a href="spec.html#testrefs.2d.path.isPointInPath.edge">2d.path.isPointInPath.edge</a> |
| 17 | |
| 18 | </ul> |
| 19 | </div> |
| 20 | |
| 21 | <p class="output">Actual output:</p> |
| 22 | <canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> |
| 23 | |
| 24 | <ul id="d"></ul> |
| 25 | <script> |
| 26 | _addTest(function(canvas, ctx) { |
| 27 | |
| 28 | ctx.rect(0, 0, 20, 20); |
| 29 | _assertSame(ctx.isPointInPath(0, 0), true, "ctx.isPointInPath(0, 0)", "true"); |
| 30 | _assertSame(ctx.isPointInPath(10, 0), true, "ctx.isPointInPath(10, 0)", "true"); |
| 31 | _assertSame(ctx.isPointInPath(20, 0), true, "ctx.isPointInPath(20, 0)", "true"); |
| 32 | _assertSame(ctx.isPointInPath(20, 10), true, "ctx.isPointInPath(20, 10)", "true"); |
| 33 | _assertSame(ctx.isPointInPath(20, 20), true, "ctx.isPointInPath(20, 20)", "true"); |
| 34 | _assertSame(ctx.isPointInPath(10, 20), true, "ctx.isPointInPath(10, 20)", "true"); |
| 35 | _assertSame(ctx.isPointInPath(0, 20), true, "ctx.isPointInPath(0, 20)", "true"); |
| 36 | _assertSame(ctx.isPointInPath(0, 10), true, "ctx.isPointInPath(0, 10)", "true"); |
| 37 | _assertSame(ctx.isPointInPath(10, -0.01), false, "ctx.isPointInPath(10, -0.01)", "false"); |
| 38 | _assertSame(ctx.isPointInPath(10, 20.01), false, "ctx.isPointInPath(10, 20.01)", "false"); |
| 39 | _assertSame(ctx.isPointInPath(-0.01, 10), false, "ctx.isPointInPath(-0.01, 10)", "false"); |
| 40 | _assertSame(ctx.isPointInPath(20.01, 10), false, "ctx.isPointInPath(20.01, 10)", "false"); |
| 41 | |
| 42 | |
| 43 | }); |
| 44 | </script> |
| 45 | |