Fixes for background tile widget

This commit is contained in:
Mal
2025-05-17 00:56:06 +02:00
parent fc990c12aa
commit 8d4bcf7c31
3 changed files with 6 additions and 2 deletions

View File

@@ -77,7 +77,7 @@ export default class Field
{
const position = this.index >= -1
? -this.index * this.tileset.getTileWidth()
: (this.index % this.tileset.background.tiles) * this.tileset.getTileWidth();
: ((this.index + 2) % this.tileset.background.tiles) * this.tileset.getTileWidth();
this.htmlElement.style.backgroundPositionX = String(position) + 'px';
}