Skip to content
Permalink
Browse files
backport #43010 and #43017
  • Loading branch information
vcloarec authored and nyalldawson committed Apr 29, 2021
1 parent eed3818 commit d9d765e57be12a70e651b20ed843b8adc7a31018
Showing with 14 additions and 7 deletions.
  1. +13 −7 src/core/qgsmaplayerlegend.cpp
  2. +1 −0 src/gui/raster/qgscolorrampshaderwidget.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.createColorRamp(),
shader.legendSettings() ? *shader.legendSettings() : QgsColorRampLegendNodeSettings(),
shader.minimumValue(),
shader.maximumValue() );
}
break;
}
Q_FALLTHROUGH();
case QgsColorRampShader::Discrete:
case QgsColorRampShader::Exact:
{
@@ -516,6 +516,7 @@ void QgsColorRampShaderWidget::mLoadFromFileButton_clicked()
settings.setValue( QStringLiteral( "lastColorMapDir" ), fileInfo.absoluteDir().absolutePath() );

loadMinimumMaximumFromTree();
updateColorRamp();
emit widgetChanged();
}

0 comments on commit d9d765e

Please sign in to comment.