Use digit images in test/assets/grid.html
The font rendering differs from platform to platform. This is an attempt to make screenshot tests platform-agnostic.
BIN
test/assets/digits/0.png
Normal file
After Width: | Height: | Size: 434 B |
BIN
test/assets/digits/1.png
Normal file
After Width: | Height: | Size: 346 B |
BIN
test/assets/digits/2.png
Normal file
After Width: | Height: | Size: 413 B |
BIN
test/assets/digits/3.png
Normal file
After Width: | Height: | Size: 434 B |
BIN
test/assets/digits/4.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
test/assets/digits/5.png
Normal file
After Width: | Height: | Size: 422 B |
BIN
test/assets/digits/6.png
Normal file
After Width: | Height: | Size: 445 B |
BIN
test/assets/digits/7.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
test/assets/digits/8.png
Normal file
After Width: | Height: | Size: 447 B |
BIN
test/assets/digits/9.png
Normal file
After Width: | Height: | Size: 437 B |
@ -9,11 +9,18 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
}
|
||||
|
||||
var palette = generatePalette(100);
|
||||
for (var i = 0; i < 1000; ++i) {
|
||||
for (var i = 0; i < 200; ++i) {
|
||||
var box = document.createElement('div');
|
||||
box.classList.add('box');
|
||||
box.textContent = i;
|
||||
box.style.setProperty('background-color', palette[i % palette.length]);
|
||||
var x = i;
|
||||
do {
|
||||
var digit = x % 10;
|
||||
x = (x / 10)|0;
|
||||
var img = document.createElement('img');
|
||||
img.src = `./digits/${digit}.png`;
|
||||
box.insertBefore(img, box.firstChild);
|
||||
} while (x);
|
||||
document.body.appendChild(box);
|
||||
}
|
||||
});
|
||||
@ -33,7 +40,9 @@ body {
|
||||
|
||||
.box {
|
||||
font-family: arial;
|
||||
display: inline-block;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 50px;
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 35 KiB |