Skip to content
Permalink
Browse files
[layouts] Use smooth pixmap transform when rendering picture items
  • Loading branch information
nirvn authored and nyalldawson committed Nov 8, 2021
1 parent ea981d8 commit a168bcad5268fcde35ff7af62b9532c2f88a02d6
@@ -92,6 +92,10 @@ void QgsLayoutItemPicture::draw( QgsLayoutItemRenderContext &context )
// painter is scaled to dots, so scale back to layout units
painter->scale( context.renderContext().scaleFactor(), context.renderContext().scaleFactor() );

const bool prevSmoothTransform = painter->testRenderHint( QPainter::RenderHint::SmoothPixmapTransform );
if ( mLayout->renderContext().testFlag( QgsLayoutRenderContext::FlagAntialiasing ) )
painter->setRenderHint( QPainter::RenderHint::SmoothPixmapTransform, true );

//picture resizing
if ( mMode != FormatUnknown )
{
@@ -203,8 +207,8 @@ void QgsLayoutItemPicture::draw( QgsLayoutItemRenderContext &context )
{
painter->drawImage( QRectF( 0, 0, boundRectWidthMM, boundRectHeightMM ), mImage, imageRect );
}

}
painter->setRenderHint( QPainter::RenderHint::SmoothPixmapTransform, prevSmoothTransform );
}

QSizeF QgsLayoutItemPicture::applyItemSizeConstraint( const QSizeF targetSize )
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit a168bca

Please sign in to comment.