Merge pull request #1127 from oleg-alexandrov/master

When splitting a view, remember the orientation
This commit is contained in:
Alessandro Muntoni 2021-10-21 10:05:23 +02:00 committed by GitHub
commit e81b4b14fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -438,6 +438,14 @@ void MainWindow::setSplit(QAction *qa)
if(mvc)
{
GLArea *glwClone=new GLArea(this, mvc, &currentGlobalParams);
// Start the new view with the same orientation as the existing one
GLArea* glArea = mvc->currentView();
if(glArea) {
QPair<Shotm,float> shotAndScale = glArea->shotFromTrackball();
glwClone->loadShot(shotAndScale);
}
//connect(glwClone, SIGNAL(insertRenderingDataForNewlyGeneratedMesh(int)), this, SLOT(addRenderingDataIfNewlyGeneratedMesh(int)));
if(qa->text() == tr("&Horizontally"))
mvc->addView(glwClone,Qt::Vertical);
@ -454,7 +462,6 @@ void MainWindow::setSplit(QAction *qa)
updateMenus();
glwClone->resetTrackBall();
glwClone->update();
}