Eliminate unnecessary expensive map redraw when opening a map

This commit is contained in:
Marcus Huderle 2020-05-20 18:30:17 -05:00
parent bc51fcf0be
commit f6c86e0eed
2 changed files with 7 additions and 1 deletions

View file

@ -268,6 +268,7 @@ private:
bool setMap(QString, bool scrollTreeView = false);
void redrawMapScene();
void refreshMapScene();
bool loadDataStructures();
bool loadProjectCombos();
bool populateMapList();

View file

@ -439,7 +439,7 @@ bool MainWindow::setMap(QString map_name, bool scrollTreeView) {
ui->mapList->setExpanded(mapListProxyModel->mapFromSource(mapListIndexes.value(editor->map->name)), false);
}
redrawMapScene();
refreshMapScene();
displayMapProperties();
if (scrollTreeView) {
@ -469,6 +469,11 @@ void MainWindow::redrawMapScene()
if (!editor->displayMap())
return;
this->refreshMapScene();
}
void MainWindow::refreshMapScene()
{
on_mainTabBar_tabBarClicked(ui->mainTabBar->currentIndex());
double base = editor->scale_base;