Fix exported metatile image scaling, remove hardcoded cell sizes

This commit is contained in:
GriffinR
2025-06-26 14:07:04 -04:00
parent bbe34e4983
commit 56d1a0d570
11 changed files with 62 additions and 59 deletions

View File

@@ -82,7 +82,7 @@ public:
this->collisionOpacity = 50;
this->collisionZoom = 30;
this->metatilesZoom = 30;
this->tilesetEditorMetatilesZoom = 30;
this->tilesetEditorMetatilesZoom = 45;
this->tilesetEditorTilesZoom = 30;
this->showPlayerView = false;
this->showCursorTile = true;

View File

@@ -9,14 +9,7 @@
class MetatileLayersItem: public SelectablePixmapItem {
Q_OBJECT
public:
MetatileLayersItem(Metatile *metatile, Tileset *primaryTileset, Tileset *secondaryTileset): SelectablePixmapItem(16, 16, 6, 2) {
this->metatile = metatile;
this->primaryTileset = primaryTileset;
this->secondaryTileset = secondaryTileset;
this->clearLastModifiedCoords();
this->clearLastHoveredCoords();
setAcceptHoverEvents(true);
}
MetatileLayersItem(Metatile *metatile, Tileset *primaryTileset, Tileset *secondaryTileset);
void draw();
void setTilesets(Tileset*, Tileset*);
void setMetatile(Metatile*);

View File

@@ -136,7 +136,7 @@ public:
this->palette = PaletteUtil::parse(palFilepath, &err);
}
this->setPixmap(QPixmap::fromImage(this->tileset));
this->numTilesWide = this->tileset.width() / 8;
this->numTilesWide = this->tileset.width() / this->cellWidth;
this->selectedTile = 0x00;
setAcceptHoverEvents(true);
}