Fix tileset editor syncing selection on save
This commit is contained in:
parent
257405f451
commit
c4cdc47e20
2 changed files with 8 additions and 2 deletions
|
@ -310,6 +310,7 @@ private:
|
|||
|
||||
bool isProjectOpen();
|
||||
void showExportMapImageWindow(bool stitchMode);
|
||||
void redrawMetatileSelection();
|
||||
};
|
||||
|
||||
enum MapListUserRoles {
|
||||
|
|
|
@ -1145,7 +1145,7 @@ void MainWindow::updateTilesetEditor() {
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::currentMetatilesSelectionChanged()
|
||||
void MainWindow::redrawMetatileSelection()
|
||||
{
|
||||
double scale = pow(3.0, static_cast<double>(porymapConfig.getMetatilesZoom() - 30) / 30.0);
|
||||
ui->graphicsView_currentMetatileSelection->setFixedSize(editor->scene_current_metatile_selection_item->pixmap().width() * scale + 2, editor->scene_current_metatile_selection_item->pixmap().height() * scale + 2);
|
||||
|
@ -1157,6 +1157,11 @@ void MainWindow::currentMetatilesSelectionChanged()
|
|||
pos *= scale;
|
||||
ui->scrollArea_2->ensureVisible(pos.x(), pos.y(), 8 * scale, 8 * scale);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::currentMetatilesSelectionChanged()
|
||||
{
|
||||
redrawMetatileSelection();
|
||||
if (this->tilesetEditor)
|
||||
this->tilesetEditor->selectMetatile(editor->metatile_selector_item->getSelectedMetatiles()->at(0));
|
||||
}
|
||||
|
@ -2583,7 +2588,7 @@ void MainWindow::on_horizontalSlider_MetatileZoom_valueChanged(int value) {
|
|||
ceil(static_cast<double>(editor->selected_border_metatiles_item->pixmap().height()) * scale) + 2);
|
||||
|
||||
ui->graphicsView_currentMetatileSelection->setMatrix(matrix);
|
||||
currentMetatilesSelectionChanged();
|
||||
redrawMetatileSelection();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionRegion_Map_Editor_triggered() {
|
||||
|
|
Loading…
Reference in a new issue