tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

2d.reset.render.miter_limit.html (849B)


      1 <!DOCTYPE html>
      2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
      3 <meta charset="UTF-8">
      4 <link rel="match" href="2d.reset.render.miter_limit-expected.html">
      5 <title>Canvas test: 2d.reset.render.miter_limit</title>
      6 <h1>2d.reset.render.miter_limit</h1>
      7 <p class="desc">check that the lines are correctly rendered with the default miter limit after reset</p>
      8 <canvas id="canvas" width="400" height="400">
      9  <p class="fallback">FAIL (fallback content)</p>
     10 </canvas>
     11 <script>
     12  const canvas = document.getElementById("canvas");
     13  const ctx = canvas.getContext('2d');
     14 
     15  ctx.miterLimit = 6;
     16 
     17  ctx.reset();
     18 
     19  ctx.lineWidth = 10;
     20 
     21  ctx.beginPath();
     22  ctx.moveTo(0, 100);
     23  for (let i = 0; i < 24; i++) {
     24    const dy = i % 2 === 0 ? 25 : -25;
     25    ctx.lineTo(Math.pow(i, 1.5) * 2, 75 + dy);
     26  }
     27  ctx.stroke();
     28 </script>