Skip to content
Permalink
Browse files
[layouts] Use smooth pixmap transform when rendering picture items
  • Loading branch information
nirvn authored and nyalldawson committed Nov 9, 2021
1 parent a559212 commit e35790dba87df60c2639a85da5686211ddaed482
@@ -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 e35790d

Please sign in to comment.