Improve responsiveness of grid
This commit is contained in:
parent
f215ecab3d
commit
72cb438741
@ -1926,6 +1926,7 @@
|
|||||||
const numberOfCaps = 1875;
|
const numberOfCaps = 1875;
|
||||||
const numberOfRows = Math.ceil(1875 / 40);
|
const numberOfRows = Math.ceil(1875 / 40);
|
||||||
const effectiveHeight = 50 - 6;
|
const effectiveHeight = 50 - 6;
|
||||||
|
const elements = imageCanvas.getElementsByTagName("img");
|
||||||
|
|
||||||
var capPositions = Array.from(
|
var capPositions = Array.from(
|
||||||
{length: numberOfCaps},
|
{length: numberOfCaps},
|
||||||
@ -1933,7 +1934,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
function setCapImageAtPosition(capId, position) {
|
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;
|
capPositions[position] = capId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user