Skip to content
Permalink
Browse files

Fix font scaling with mask effect

  • Loading branch information
nyalldawson committed Jul 7, 2020
1 parent 75a6740 commit 10c044e8c850cb82f6782f08ed2764983419c86e
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/core/textrenderer/qgstextrenderer.cpp
@@ -426,26 +426,31 @@ void QgsTextRenderer::drawMask( QgsRenderContext &context, const QgsTextRenderer

// scale for any print output or image saving @ specific dpi
p->scale( component.dpiRatio, component.dpiRatio );
if ( scaleFactor != 1.0 )
p->scale( 1 / scaleFactor, 1 / scaleFactor );
if ( mask.paintEffect() && mask.paintEffect()->enabled() )
{
QgsPainterSwapper swapper( context, p );
{
QgsEffectPainter effectPainter( context, mask.paintEffect() );
if ( scaleFactor != 1.0 )
context.painter()->scale( 1 / scaleFactor, 1 / scaleFactor );
context.painter()->setPen( pen );
context.painter()->setBrush( brush );
context.painter()->drawPath( path );
if ( scaleFactor != 1.0 )
context.painter()->scale( scaleFactor, scaleFactor );
}
}
else
{
if ( scaleFactor != 1.0 )
p->scale( 1 / scaleFactor, 1 / scaleFactor );
p->setPen( pen );
p->setBrush( brush );
p->drawPath( path );
if ( scaleFactor != 1.0 )
p->scale( scaleFactor, scaleFactor );

}
if ( scaleFactor != 1.0 )
p->scale( scaleFactor, scaleFactor );
}

double QgsTextRenderer::textWidth( const QgsRenderContext &context, const QgsTextFormat &format, const QStringList &textLines, QFontMetricsF * )

0 comments on commit 10c044e

Please sign in to comment.
You can’t perform that action at this time.