Skip to content

Commit

Permalink
Fix font size if size is in map units
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed May 11, 2021
1 parent 16d83c7 commit d9b997d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/layertree/qgslayertreemodellegendnode.cpp
Expand Up @@ -1477,8 +1477,8 @@ QSizeF QgsVectorLabelLegendNode::drawSymbol( const QgsLegendSettings &settings,
{
QStringList textLines( "Aa" );
QgsTextFormat textFormat = mLabelSettings.format();
textFormat.setSize( textFormat.size() / renderContext.scaleFactor() ); //painter is usually scaled (e.g. mm unit)
QgsRenderContext ctx( renderContext );
ctx.setScaleFactor( 1.0 );
double textWidth, textHeight;
textWidthHeight( textWidth, textHeight, ctx, textFormat, textLines );
QPointF textPos( xOffset + settings.symbolSize().width() / 2.0 - textWidth / 2.0, yOffset + settings.symbolSize().height() / 2.0 + textHeight / 2.0 );
Expand Down

0 comments on commit d9b997d

Please sign in to comment.