Improve responsiveness of grid

This commit is contained in:
Christoph Hagen 2022-12-16 18:23:22 +01:00
parent f215ecab3d
commit 72cb438741

View File

@ -1926,6 +1926,7 @@
const numberOfCaps = 1875;
const numberOfRows = Math.ceil(1875 / 40);
const effectiveHeight = 50 - 6;
const elements = imageCanvas.getElementsByTagName("img");
var capPositions = Array.from(
{length: numberOfCaps},
@ -1933,7 +1934,7 @@
);
function setCapImageAtPosition(capId, position) {
imageCanvas.getElementsByTagName("img")[position].src = "thumbnails/" + `${capId}.jpg`.padStart(8, '0');
elements[position].src = "thumbnails/" + `${capId}.jpg`.padStart(8, '0');
capPositions[position] = capId;
}