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.
This commit is contained in:
Andrey Lushnikov 2017-06-16 16:00:36 -07:00
parent 6bed8c62b3
commit 7d04d112da
13 changed files with 12 additions and 3 deletions

BIN
test/assets/digits/0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

BIN
test/assets/digits/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

BIN
test/assets/digits/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

BIN
test/assets/digits/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

BIN
test/assets/digits/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

BIN
test/assets/digits/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

BIN
test/assets/digits/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

BIN
test/assets/digits/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

BIN
test/assets/digits/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

BIN
test/assets/digits/9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

View File

@ -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;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 35 KiB