mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
Apply review suggestions
This commit is contained in:
parent
10a7e974cf
commit
7071c4e3de
@ -245,12 +245,17 @@ QDomElement QgsCameraController::writeXml( QDomDocument &doc ) const
|
||||
{
|
||||
QDomElement elemCamera = doc.createElement( QStringLiteral( "camera" ) );
|
||||
QgsVector3D centerPoint;
|
||||
if ( mScene->mapSettings()->sceneMode() == Qgis::SceneMode::Local )
|
||||
centerPoint = mCameraPose.centerPoint();
|
||||
else if ( mScene->mapSettings()->sceneMode() == Qgis::SceneMode::Globe )
|
||||
// Save center point in map coordinates, since our world origin won't be
|
||||
// the same on loading
|
||||
centerPoint = mCameraPose.centerPoint() + mOrigin;
|
||||
switch ( mScene->mapSettings()->sceneMode() )
|
||||
{
|
||||
case Qgis::SceneMode::Local:
|
||||
centerPoint = mCameraPose.centerPoint();
|
||||
break;
|
||||
case Qgis::SceneMode::Globe:
|
||||
// Save center point in map coordinates, since our world origin won't be
|
||||
// the same on loading
|
||||
centerPoint = mCameraPose.centerPoint() + mOrigin;
|
||||
break;
|
||||
}
|
||||
elemCamera.setAttribute( QStringLiteral( "x" ), centerPoint.x() );
|
||||
elemCamera.setAttribute( QStringLiteral( "y" ), centerPoint.z() );
|
||||
elemCamera.setAttribute( QStringLiteral( "elev" ), centerPoint.y() );
|
||||
|
Loading…
x
Reference in New Issue
Block a user