Fix sprite display to show front-facing frame instead of full sheet

The NPC sprite images are horizontal strips with multiple frames. Previously
the entire sheet was squeezed into the container, showing all frames at once.
Now the image height fills the container with auto width, and overflow:hidden
clips to just the first (front-facing) frame.

https://claude.ai/code/session_01LgEDXY2DGWvLdHvhmM5Xqy
This commit is contained in:
Claude 2026-03-21 13:18:17 +00:00
parent 54f2168d7e
commit 34d9e833db
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -2140,7 +2140,7 @@ function getSpriteHtml(graphicsId, size = 32) {
const url = getSpriteUrl(graphicsId);
const name = (graphicsId || '').replace('OBJ_EVENT_GFX_', '').replace(/_/g, ' ');
return `<div class="sprite-container" style="width:${size}px;height:${size}px">
<img src="${url}" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" style="width:${size}px;height:${size}px;image-rendering:pixelated" alt="${escAttr(name)}">
<img src="${url}" onerror="this.style.display='none';this.nextElementSibling.style.display='flex'" style="height:${size}px;width:auto;image-rendering:pixelated" alt="${escAttr(name)}">
<div class="sprite-fallback" style="display:none;width:${size}px;height:${size}px">${escHtml(name.substring(0, 2).toUpperCase())}</div>
</div>`;
}

View File

@ -1200,7 +1200,7 @@ tbody tr:last-child td { border-bottom: none; }
background: var(--bg);
display: flex;
align-items: center;
justify-content: center;
justify-content: flex-start;
}
.sprite-fallback {
align-items: center;