Ignore invalid metatiles in tileset editor when syncing
This commit is contained in:
parent
b04638b4cf
commit
0e04d2250b
2 changed files with 6 additions and 4 deletions
|
@ -106,9 +106,11 @@ void TilesetEditor::init(Project *project, Map *map) {
|
|||
}
|
||||
|
||||
void TilesetEditor::selectMetatile(uint16_t metatileId) {
|
||||
this->metatileSelector->select(metatileId);
|
||||
QPoint pos = this->metatileSelector->getMetatileIdCoordsOnWidget(metatileId);
|
||||
this->ui->scrollArea_Metatiles->ensureVisible(pos.x(), pos.y());
|
||||
if (Tileset::metatileIsValid(metatileId, this->primaryTileset, this->secondaryTileset)) {
|
||||
this->metatileSelector->select(metatileId);
|
||||
QPoint pos = this->metatileSelector->getMetatileIdCoordsOnWidget(metatileId);
|
||||
this->ui->scrollArea_Metatiles->ensureVisible(pos.x(), pos.y());
|
||||
}
|
||||
}
|
||||
|
||||
void TilesetEditor::setMap(Map *map) {
|
||||
|
|
|
@ -62,7 +62,7 @@ void TilesetEditorMetatileSelector::updateSelectedMetatile() {
|
|||
if (Tileset::metatileIsValid(metatileId, this->primaryTileset, this->secondaryTileset))
|
||||
this->selectedMetatile = metatileId;
|
||||
else
|
||||
this->selectedMetatile = 0;
|
||||
this->selectedMetatile = Project::getNumMetatilesPrimary() + this->secondaryTileset->metatiles->length() - 1;
|
||||
emit selectedMetatileChanged(this->selectedMetatile);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue