Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<meta charset="UTF-8">
<title>OffscreenCanvas test: 2d.path.isPointInStroke.nobitmap.transform</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>
<h1>2d.path.isPointInStroke.nobitmap.transform</h1>
<p class="desc">isPointInStroke() honours the transformation matrix on a canvas with no bitmap</p>
<script>
var t = async_test("isPointInStroke() honours the transformation matrix on a canvas with no bitmap");
var t_pass = t.done.bind(t);
var t_fail = t.step_func(function(reason) {
throw reason;
});
t.step(function() {
var canvas = new OffscreenCanvas(0, 0);
var ctx = canvas.getContext('2d');
ctx.lineWidth = 10;
ctx.translate(50, 0);
ctx.moveTo(0, 10);
ctx.lineTo(40, 10);
_assertSame(ctx.isPointInStroke(70, 10), true, "ctx.isPointInStroke(70, 10)", "true");
_assertSame(ctx.isPointInStroke(20, 10), false, "ctx.isPointInStroke(20, 10)", "false");
t.done();
});
</script>