Skip to content

Commit

Permalink
Don't forget to load/save background and selection colors
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Aug 25, 2018
1 parent d9f67f8 commit f0dcf7f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/3d/qgs3dmapsettings.cpp
Expand Up @@ -63,6 +63,13 @@ void Qgs3DMapSettings::readXml( const QDomElement &elem, const QgsReadWriteConte
elemOrigin.attribute( "y" ).toDouble(),
elemOrigin.attribute( "z" ).toDouble() );

QDomElement elemColor = elem.firstChildElement( "color" );
if ( !elemColor.isNull() )
{
mBackgroundColor = QgsSymbolLayerUtils::decodeColor( elemColor.attribute( "background" ) );
mSelectionColor = QgsSymbolLayerUtils::decodeColor( elemColor.attribute( "selection" ) );
}

QDomElement elemCrs = elem.firstChildElement( "crs" );
mCrs.readXml( elemCrs );

Expand Down Expand Up @@ -147,6 +154,11 @@ QDomElement Qgs3DMapSettings::writeXml( QDomDocument &doc, const QgsReadWriteCon
elemOrigin.setAttribute( "z", QString::number( mOrigin.z() ) );
elem.appendChild( elemOrigin );

QDomElement elemColor = doc.createElement( "color" );
elemColor.setAttribute( "background", QgsSymbolLayerUtils::encodeColor( mBackgroundColor ) );
elemColor.setAttribute( "selection", QgsSymbolLayerUtils::encodeColor( mSelectionColor ) );
elem.appendChild( elemColor );

QDomElement elemCrs = doc.createElement( "crs" );
mCrs.writeXml( elemCrs, doc );
elem.appendChild( elemCrs );
Expand Down

0 comments on commit f0dcf7f

Please sign in to comment.