Remove some unnecessary redrawing

This commit is contained in:
GriffinR 2024-01-26 10:54:05 -05:00
parent d74affe0b9
commit 140b66862a

View file

@ -333,9 +333,11 @@ void TilesetEditor::refresh() {
} }
} }
this->ui->graphicsView_Tiles->setSceneRect(0, 0, this->tileSelector->pixmap().width(), this->tileSelector->pixmap().height());
this->ui->graphicsView_Metatiles->setSceneRect(0, 0, this->metatileSelector->pixmap().width(), this->metatileSelector->pixmap().height());
this->ui->graphicsView_selectedTile->setFixedSize(this->selectedTilePixmapItem->pixmap().width() + 2, this->selectedTilePixmapItem->pixmap().height() + 2);
this->redrawTileSelector(); this->redrawTileSelector();
this->redrawMetatileSelector(); this->redrawMetatileSelector();
this->ui->graphicsView_selectedTile->setFixedSize(this->selectedTilePixmapItem->pixmap().width() + 2, this->selectedTilePixmapItem->pixmap().height() + 2);
} }
void TilesetEditor::drawSelectedTiles() { void TilesetEditor::drawSelectedTiles() {
@ -1191,7 +1193,6 @@ void TilesetEditor::on_horizontalSlider_MetatilesZoom_valueChanged(int value) {
void TilesetEditor::redrawMetatileSelector() { void TilesetEditor::redrawMetatileSelector() {
QSize size(this->metatileSelector->pixmap().width(), this->metatileSelector->pixmap().height()); QSize size(this->metatileSelector->pixmap().width(), this->metatileSelector->pixmap().height());
this->ui->graphicsView_Metatiles->setSceneRect(0, 0, size.width() + 2, size.height() + 2);
double scale = pow(3.0, static_cast<double>(porymapConfig.getTilesetEditorMetatilesZoom() - 30) / 30.0); double scale = pow(3.0, static_cast<double>(porymapConfig.getTilesetEditorMetatilesZoom() - 30) / 30.0);
QTransform transform; QTransform transform;
@ -1213,7 +1214,6 @@ void TilesetEditor::on_horizontalSlider_TilesZoom_valueChanged(int value) {
void TilesetEditor::redrawTileSelector() { void TilesetEditor::redrawTileSelector() {
QSize size(this->tileSelector->pixmap().width(), this->tileSelector->pixmap().height()); QSize size(this->tileSelector->pixmap().width(), this->tileSelector->pixmap().height());
this->ui->graphicsView_Tiles->setSceneRect(0, 0, size.width() + 2, size.height() + 2);
double scale = pow(3.0, static_cast<double>(porymapConfig.getTilesetEditorTilesZoom() - 30) / 30.0); double scale = pow(3.0, static_cast<double>(porymapConfig.getTilesetEditorTilesZoom() - 30) / 30.0);
QTransform transform; QTransform transform;