Skip to content

Commit

Permalink
Retain subsymbol if possible when changing symbol layer types
Browse files Browse the repository at this point in the history
E.g. don't reset the marker symbol when changing between centroid/
point pattern/random marker fills. Cos that's just annoying.
  • Loading branch information
nyalldawson committed Oct 25, 2021
1 parent d98819d commit 03e304f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/symbology/qgslayerpropertieswidget.cpp
Expand Up @@ -330,6 +330,12 @@ void QgsLayerPropertiesWidget::layerTypeChanged()
if ( !newLayer )
return;

// also try to copy the subsymbol, if its the same type as the new symbol layer's subsymbol
if ( newLayer->subSymbol() && layer->subSymbol() && newLayer->subSymbol()->type() == layer->subSymbol()->type() )
{
newLayer->setSubSymbol( layer->subSymbol()->clone() );
}

updateSymbolLayerWidget( newLayer );
emit changeLayer( newLayer );
}
Expand Down

0 comments on commit 03e304f

Please sign in to comment.