Skip to content

Commit 581b6f4

Browse files
Gingehimplicitfield
authored andcommitted
LibWeb: Add tests for ellipses with varying angles and directions
(cherry picked from commit 74e12a9)
1 parent 0a95401 commit 581b6f4

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Tests/LibWeb/Screenshot/canvas-arcs-and-ellipses.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
image-rendering: pixelated;
66
}
77
</style>
8-
<canvas id="canvas" width="125" height="125"></canvas>
8+
<canvas id="canvas" width="550" height="325"></canvas>
99
<script>
1010
const canvas = document.getElementById("canvas")
1111

@@ -19,4 +19,19 @@
1919
context.ellipse(20,20,15,8,1.2273132071162383,4.1926143018618225,2.8853539230051624);
2020
context.stroke();
2121
context.fill();
22+
23+
for (let i = 0; i < 2; i++) {
24+
for (let j = -5; j <= 5; j++) {
25+
context.beginPath();
26+
let x = 25 + (j + 5) * 50;
27+
let y = 150 + i * 50;
28+
let radius = 20;
29+
let startAngle = 0;
30+
let endAngle = (Math.PI * j) / 2;
31+
let counterclockwise = i == 1;
32+
33+
context.arc(x, y, radius, startAngle, endAngle, counterclockwise);
34+
context.stroke();
35+
}
36+
}
2237
</script>
-4.48 KB
Loading

0 commit comments

Comments
 (0)