Eliminate unnecessary expensive map redraw when opening a map
This commit is contained in:
parent
bc51fcf0be
commit
f6c86e0eed
2 changed files with 7 additions and 1 deletions
|
@ -268,6 +268,7 @@ private:
|
||||||
|
|
||||||
bool setMap(QString, bool scrollTreeView = false);
|
bool setMap(QString, bool scrollTreeView = false);
|
||||||
void redrawMapScene();
|
void redrawMapScene();
|
||||||
|
void refreshMapScene();
|
||||||
bool loadDataStructures();
|
bool loadDataStructures();
|
||||||
bool loadProjectCombos();
|
bool loadProjectCombos();
|
||||||
bool populateMapList();
|
bool populateMapList();
|
||||||
|
|
|
@ -439,7 +439,7 @@ bool MainWindow::setMap(QString map_name, bool scrollTreeView) {
|
||||||
ui->mapList->setExpanded(mapListProxyModel->mapFromSource(mapListIndexes.value(editor->map->name)), false);
|
ui->mapList->setExpanded(mapListProxyModel->mapFromSource(mapListIndexes.value(editor->map->name)), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
redrawMapScene();
|
refreshMapScene();
|
||||||
displayMapProperties();
|
displayMapProperties();
|
||||||
|
|
||||||
if (scrollTreeView) {
|
if (scrollTreeView) {
|
||||||
|
@ -469,6 +469,11 @@ void MainWindow::redrawMapScene()
|
||||||
if (!editor->displayMap())
|
if (!editor->displayMap())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this->refreshMapScene();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::refreshMapScene()
|
||||||
|
{
|
||||||
on_mainTabBar_tabBarClicked(ui->mainTabBar->currentIndex());
|
on_mainTabBar_tabBarClicked(ui->mainTabBar->currentIndex());
|
||||||
|
|
||||||
double base = editor->scale_base;
|
double base = editor->scale_base;
|
||||||
|
|
Loading…
Reference in a new issue