Skip to content
Permalink
Browse files
allow not continuous legend for mesh layer
  • Loading branch information
vcloarec authored and nyalldawson committed Apr 29, 2021
1 parent 3790971 commit 847bbe10788c9962dd9c46cf0904380ffc9473b0
Showing with 13 additions and 7 deletions.
  1. +13 −7 src/core/qgsmaplayerlegend.cpp
@@ -519,13 +519,19 @@ QList<QgsLayerTreeModelLegendNode *> QgsDefaultMeshLayerLegend::createLayerTreeM
switch ( shader.colorRampType() )
{
case QgsColorRampShader::Interpolated:
// for interpolated shaders we use a ramp legend node
nodes << new QgsColorRampLegendNode( nodeLayer, shader.sourceColorRamp()->clone(),
shader.legendSettings() ? *shader.legendSettings() : QgsColorRampLegendNodeSettings(),
shader.minimumValue(),
shader.maximumValue() );
break;

if ( ! shader.legendSettings() || shader.legendSettings()->useContinuousLegend() )
{
// for interpolated shaders we use a ramp legend node
if ( !shader.colorRampItemList().isEmpty() )
{
nodes << new QgsColorRampLegendNode( nodeLayer, shader.sourceColorRamp()->clone(),
shader.legendSettings() ? *shader.legendSettings() : QgsColorRampLegendNodeSettings(),
shader.minimumValue(),
shader.maximumValue() );
}
break;
}
Q_FALLTHROUGH();
case QgsColorRampShader::Discrete:
case QgsColorRampShader::Exact:
{

0 comments on commit 847bbe1

Please sign in to comment.