Tests: Add screenshot test for Canvas2D fillstyle opacity

This commit is contained in:
Lucien Fiorini 2024-12-19 12:21:52 +01:00 committed by Alexander Kalenik
parent 26970201bd
commit b909e3d587
Notes: github-actions[bot] 2024-12-19 12:32:10 +00:00
3 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,11 @@
<style>
* {
margin: 0;
}
body {
background-color: white;
}
</style>
<img src="../images/canvas-fillstyle-opacity.png">

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

@ -0,0 +1,19 @@
<link rel="match" href="../expected/canvas-fillstyle-opacity-ref.html" />
<style>
* {
margin: 0;
}
body {
background-color: white;
}
</style>
<canvas id="myCanvas" width="200" height="200"></canvas>
<script>
const canvas = document.getElementById('myCanvas');
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0, 0, 255, 0.5)';
ctx.fillRect(50, 50, 100, 100);
</script>