content/canvas/test/test_2d.isPointInPath.winding.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/canvas/test/test_2d.isPointInPath.winding.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<title>Canvas test: 2d.isPointInPath.winding</title>
     1.6 +<script src="/tests/SimpleTest/SimpleTest.js"></script>
     1.7 +<link rel="stylesheet" href="/tests/SimpleTest/test.css">
     1.8 +<body>
     1.9 +<canvas id="c" width="100" height="100"><p class="fallback">FAIL (fallback content)</p></canvas>
    1.10 +<script>
    1.11 +SimpleTest.waitForExplicitFinish();
    1.12 +addLoadEvent(function () {
    1.13 +
    1.14 +var canvas = document.getElementById('c');
    1.15 +var ctx = canvas.getContext('2d');
    1.16 +
    1.17 +ctx.beginPath();
    1.18 +ctx.rect(0, 0, 100, 100);
    1.19 +ctx.rect(25, 25, 50, 50);
    1.20 +ok(ctx.isPointInPath(50, 50));
    1.21 +
    1.22 +ctx.beginPath();
    1.23 +ctx.rect(0, 0, 100, 100);
    1.24 +ctx.rect(25, 25, 50, 50);
    1.25 +ok(ctx.isPointInPath(50, 50, 'evenodd') == false);
    1.26 +
    1.27 +SimpleTest.finish();
    1.28 +
    1.29 +});
    1.30 +</script>
    1.31 +

mercurial