Skip to content
Permalink
Browse files
Restore some previous rendering behaviour
  • Loading branch information
nyalldawson committed Nov 7, 2021
1 parent ce50674 commit ac6bbd662df0273b873463281ab04f27a666e2a8
Showing with 6 additions and 1 deletion.
  1. +3 −0 src/core/raster/qgsrasterlayerrenderer.cpp
  2. +3 −1 src/core/textrenderer/qgstextrenderer.cpp
@@ -337,6 +337,9 @@ bool QgsRasterLayerRenderer::render()
projector->setCrs( mRasterViewPort->mSrcCRS, mRasterViewPort->mDestCRS, mRasterViewPort->mTransformContext );
}

// important -- disable SmoothPixmapTransform for raster layer renders. We want individual pixels to be clearly defined!
renderContext()->painter()->setRenderHint( QPainter::SmoothPixmapTransform, false );

// Drawer to pipe?
QgsRasterIterator iterator( mPipe->last() );
QgsRasterDrawer drawer( &iterator, renderContext()->dpiTarget() );
@@ -1233,8 +1233,10 @@ void QgsTextRenderer::drawShadow( QgsRenderContext &context, const QgsTextRender
-offsetDist * std::sin( angleRad + M_PI_2 ) );

p->save();
p->setRenderHint( QPainter::SmoothPixmapTransform );
context.setPainterFlagsUsingContext( p );
// this was historically ALWAYS set for text renderer. We may want to consider getting it to respect the
// corresponding flag in the render context instead...
p->setRenderHint( QPainter::SmoothPixmapTransform );
if ( context.useAdvancedEffects() )
{
p->setCompositionMode( shadow.blendMode() );

0 comments on commit ac6bbd6

Please sign in to comment.