Skip to content

Commit 2883fbc

Browse files
committed
Keep image aspect in bilinear resampling, apply oversampling for zoom out
1 parent 662ec12 commit 2883fbc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/raster/qgsbilinearrasterresampler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ QgsBilinearRasterResampler::~QgsBilinearRasterResampler()
2929

3030
void QgsBilinearRasterResampler::resample( const QImage& srcImage, QImage& dstImage )
3131
{
32-
dstImage = srcImage.scaled( dstImage.width(), dstImage.height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
32+
dstImage = srcImage.scaled( dstImage.width(), dstImage.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation );
3333
}

src/core/raster/qgsrasterrenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void QgsRasterRenderer::startRasterRead( int bandNumber, QgsRasterViewPort* view
5959
providerExtent = t.transformBoundingBox( providerExtent );
6060
}
6161
double pixelRatio = mapToPixel->mapUnitsPerPixel() / ( providerExtent.width() / mProvider->xSize() );
62-
oversampling = pixelRatio > 1.0 ? 1.0 : pixelRatio;
62+
oversampling = ( pixelRatio > 4.0 ) ? 4.0 : pixelRatio;
6363
}
6464

6565
//split raster into small portions if necessary

0 commit comments

Comments
 (0)