LibWeb: Add tests for ellipses with varying angles and directions
This commit is contained in:
parent
1b8c0cd368
commit
74e12a9c97
Notes:
github-actions[bot]
2024-09-07 09:38:42 +00:00
Author: https://github.com/Gingeh Commit: https://github.com/LadybirdBrowser/ladybird/commit/74e12a9c97e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1308
2 changed files with 16 additions and 1 deletions
Tests/LibWeb/Screenshot
|
@ -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 ![]() ![]() |
Loading…
Add table
Reference in a new issue