Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify shader clone (use copy ctor)
  • Loading branch information
elpaso committed May 6, 2021
1 parent 6a9133c commit 3c8b24d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/core/raster/qgssinglebandpseudocolorrenderer.cpp
Expand Up @@ -90,16 +90,7 @@ QgsSingleBandPseudoColorRenderer *QgsSingleBandPseudoColorRenderer::clone() cons

if ( origColorRampShader )
{
QgsColorRampShader *colorRampShader = new QgsColorRampShader( mShader->minimumValue(), mShader->maximumValue() );

if ( origColorRampShader->sourceColorRamp() )
{
colorRampShader->setSourceColorRamp( origColorRampShader->sourceColorRamp()->clone() );
}
colorRampShader->setColorRampType( origColorRampShader->colorRampType() );
colorRampShader->setClassificationMode( origColorRampShader->classificationMode() );
colorRampShader->setClip( origColorRampShader->clip() );
colorRampShader->setColorRampItemList( origColorRampShader->colorRampItemList() );
QgsColorRampShader *colorRampShader = new QgsColorRampShader( *origColorRampShader );
shader->setRasterShaderFunction( colorRampShader );
}
}
Expand Down

0 comments on commit 3c8b24d

Please sign in to comment.