2008-08-10 21:01:14 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<title>Canvas test: 2d.path.isPointInPath.arc</title>
|
|
|
|
<!-- Testing: isPointInPath() works on arcs -->
|
2009-05-06 13:46:04 -07:00
|
|
|
<script src="/MochiKit/packed.js"></script>
|
2008-08-10 21:01:14 -07:00
|
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
|
|
|
<body>
|
|
|
|
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
MochiKit.DOM.addLoadEvent(function () {
|
|
|
|
|
|
|
|
var canvas = document.getElementById('c');
|
|
|
|
var ctx = canvas.getContext('2d');
|
|
|
|
|
|
|
|
ctx.arc(50, 25, 10, 0, Math.PI, false);
|
|
|
|
ok(ctx.isPointInPath(50, 10) === false, "ctx.isPointInPath(50, 10) === false");
|
|
|
|
ok(ctx.isPointInPath(50, 20) === false, "ctx.isPointInPath(50, 20) === false");
|
|
|
|
ok(ctx.isPointInPath(50, 30) === true, "ctx.isPointInPath(50, 30) === true");
|
|
|
|
ok(ctx.isPointInPath(50, 40) === false, "ctx.isPointInPath(50, 40) === false");
|
|
|
|
ok(ctx.isPointInPath(30, 20) === false, "ctx.isPointInPath(30, 20) === false");
|
|
|
|
ok(ctx.isPointInPath(70, 20) === false, "ctx.isPointInPath(70, 20) === false");
|
|
|
|
ok(ctx.isPointInPath(30, 30) === false, "ctx.isPointInPath(30, 30) === false");
|
|
|
|
ok(ctx.isPointInPath(70, 30) === false, "ctx.isPointInPath(70, 30) === false");
|
|
|
|
|
|
|
|
SimpleTest.finish();
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|