fix loading

This commit is contained in:
redbirdly 2024-06-16 17:24:37 +08:00 committed by GitHub
parent 255c9b4fc6
commit bb53defd92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -265,9 +265,9 @@ elements.plasma.tick = function(pixel) {
lightmap[y][x] = { color: plasmaColor };
};
// Wait for loading
// if it loads too soon then width will be undefined
setTimeout(() => { initializeLightmap(width, height); }, 700);
window.addEventListener('load', function() {
initializeLightmap(width, height);
});
// Add code to functions instead of replacing them
let originalTick = tick;