ladybird/Tests/LibWeb/Screenshot/input/canvas-path-rect.html
Sam Atkins b7efb61fbe Tests/LibWeb: Restructure Ref and Screenshot test dirs to match others
Now each test type has the same directories:
- input
- expected
- data

Also, tests can be in subdirectories within ./input.
2024-11-05 14:02:07 +00:00

40 lines
1,003 B
HTML

<link rel="match" href="../expected/canvas-path-rect-ref.html" />
<style>
* {
margin: 0;
}
body {
background-color: white;
}
</style>
<canvas width=500 height=500></canvas>
<script>
function drawRect() {
var canvas = document.querySelector("canvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle = 'black';
ctx.fillRect(0, 0, 500, 500);
ctx.fillStyle = 'red';
ctx.beginPath();
ctx.rect(10, 20, 150, 100);
ctx.fill();
ctx.fillStyle = 'yellow';
ctx.beginPath();
ctx.roundRect(50, 310, 100, 100, 25);
ctx.fill('evenodd');
ctx.fillStyle = 'green';
ctx.beginPath();
ctx.rect(200, 210, 100, 100);
ctx.fill('evenodd');
ctx.rotate(0.2);
ctx.fillStyle = 'orange';
ctx.beginPath();
ctx.roundRect(325, 300, 100, 100, [ { x: 5, y: 20 }, 10, { x: 15, y: 30 }, 20 ]);
ctx.fill('evenodd');
}
drawRect();
</script>