Skip to content
Permalink
Browse files
[layouts] Use smooth pixmap transform when rendering picture items
  • Loading branch information
nirvn authored and github-actions committed Nov 8, 2021
1 parent f569622 commit 14560e25e8b2dc43d18946c35e674b4eb133cd41
@@ -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 14560e2

Please sign in to comment.