Skip to content
Permalink
Browse files
Retain subsymbol if possible when changing symbol layer types
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 03e304fbb8bdf174be00290ae1475b258d3b204a
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/gui/symbology/qgslayerpropertieswidget.cpp
@@ -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 );
}

0 comments on commit 03e304f

Please sign in to comment.