LibWeb: Add tests for ellipses with varying angles and directions

This commit is contained in:
Gingeh 2024-09-07 11:29:15 +10:00 committed by Andreas Kling
parent 1b8c0cd368
commit 74e12a9c97
Notes: github-actions[bot] 2024-09-07 09:38:42 +00:00
2 changed files with 16 additions and 1 deletions

View file

@ -5,7 +5,7 @@
image-rendering: pixelated;
}
</style>
<canvas id="canvas" width="125" height="125"></canvas>
<canvas id="canvas" width="550" height="325"></canvas>
<script>
const canvas = document.getElementById("canvas")
@ -19,4 +19,19 @@
context.ellipse(20,20,15,8,1.2273132071162383,4.1926143018618225,2.8853539230051624);
context.stroke();
context.fill();
for (let i = 0; i < 2; i++) {
for (let j = -5; j <= 5; j++) {
context.beginPath();
let x = 25 + (j + 5) * 50;
let y = 150 + i * 50;
let radius = 20;
let startAngle = 0;
let endAngle = (Math.PI * j) / 2;
let counterclockwise = i == 1;
context.arc(x, y, radius, startAngle, endAngle, counterclockwise);
context.stroke();
}
}
</script>

Binary file not shown.

Before

(image error) Size: 2.3 KiB

After

(image error) Size: 13 KiB