Skip to content

Commit

Permalink
Fix incorrect use of QgsRasterPipie::setOn when changing raster pipe …
Browse files Browse the repository at this point in the history
…resampling stage
  • Loading branch information
nyalldawson committed Jun 23, 2021
1 parent f62ddb3 commit 5875b3d
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/core/raster/qgsrasterpipe.cpp
Expand Up @@ -364,10 +364,20 @@ bool QgsRasterPipe::checkBounds( int idx ) const
void QgsRasterPipe::setResamplingStage( Qgis::RasterResamplingStage stage )
{
mResamplingStage = stage;
setOn( ResamplerRole, stage == ResamplingStage::ResampleFilter );
QgsRasterDataProvider *l_provider = provider();
if ( l_provider )

int resamplerIndex = 0;
for ( QgsRasterInterface *interface : std::as_const( mInterfaces ) )
{
if ( interfaceRole( interface ) == Qgis::RasterPipeInterfaceRole::Resampler )
{
setOn( resamplerIndex, stage == Qgis::RasterResamplingStage::ResampleFilter );
break;
}
resamplerIndex ++;
}

if ( QgsRasterDataProvider *l_provider = provider() )
{
l_provider->enableProviderResampling( stage == ResamplingStage::Provider );
l_provider->enableProviderResampling( stage == Qgis::RasterResamplingStage::Provider );
}
}

0 comments on commit 5875b3d

Please sign in to comment.