fix offsets

This commit is contained in:
tree🌴 2024-03-16 20:55:28 +01:00
parent 935805fe1f
commit 17a37aa06c
1 changed files with 4 additions and 3 deletions

View File

@ -90,11 +90,12 @@ function getImageUrl(img) {
return `/gen-img/events/${img}.png` return `/gen-img/events/${img}.png`
} }
function getImageData(img) { function getImageData(img) {
const offsets = genImagesOffsets[img];
return Object.assign({}, genImages[img], { return Object.assign({}, genImages[img], {
src: `/gen-img/events/${img}.png`, src: `/gen-img/events/${img}.png`,
offsets: genImagesOffsets[img], offsets,
calcObjOffsets: function (tp) { calcObjOffsets: function (tp) {
const co = image.offsets?.[tp]; const co = offsets?.[tp];
if (!co) { if (!co) {
return ''; return '';
} }
@ -102,7 +103,7 @@ function getImageData(img) {
}, },
calcBgOffsets: function(tp) { calcBgOffsets: function(tp) {
const arr = []; const arr = [];
const co = image.offsets?.[tp]; const co = offsets?.[tp];
if (!co) { if (!co) {
return ''; return '';
} }