Navigation Menu

Skip to content

Commit

Permalink
Fix font scaling with mask effect
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 7, 2020
1 parent 75a6740 commit 10c044e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/core/textrenderer/qgstextrenderer.cpp
Expand Up @@ -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 * )
Expand Down

0 comments on commit 10c044e

Please sign in to comment.