@@ -84,7 +84,6 @@ void QgsTextRenderer::drawText( const QRectF &rect, double rotation, Qgis::TextH
84
84
QgsTextFormat tmpFormat = format;
85
85
if ( format.dataDefinedProperties ().hasActiveProperties () ) // note, we use format instead of tmpFormat here, it's const and potentially avoids a detach
86
86
tmpFormat.updateDataDefinedProperties ( context );
87
- tmpFormat = updateShadowPosition ( tmpFormat );
88
87
89
88
QStringList textLines;
90
89
for ( const QString &line : text )
@@ -110,17 +109,19 @@ void QgsTextRenderer::drawText( const QRectF &rect, double rotation, Qgis::TextH
110
109
111
110
void QgsTextRenderer::drawDocument ( const QRectF &rect, const QgsTextFormat &format, const QgsTextDocument &document, const QgsTextDocumentMetrics &metrics, QgsRenderContext &context, Qgis::TextHorizontalAlignment horizontalAlignment, Qgis::TextVerticalAlignment verticalAlignment, double rotation, Qgis::TextLayoutMode mode, Qgis::TextRendererFlags )
112
111
{
113
- if ( format.background ().enabled () )
112
+ const QgsTextFormat tmpFormat = updateShadowPosition ( format );
113
+
114
+ if ( tmpFormat.background ().enabled () )
114
115
{
115
- drawPart ( rect, rotation, horizontalAlignment, verticalAlignment, document, metrics, context, format , Qgis::TextComponent::Background, mode );
116
+ drawPart ( rect, rotation, horizontalAlignment, verticalAlignment, document, metrics, context, tmpFormat , Qgis::TextComponent::Background, mode );
116
117
}
117
118
118
- if ( format .buffer ().enabled () )
119
+ if ( tmpFormat .buffer ().enabled () )
119
120
{
120
- drawPart ( rect, rotation, horizontalAlignment, verticalAlignment, document, metrics, context, format , Qgis::TextComponent::Buffer, mode );
121
+ drawPart ( rect, rotation, horizontalAlignment, verticalAlignment, document, metrics, context, tmpFormat , Qgis::TextComponent::Buffer, mode );
121
122
}
122
123
123
- drawPart ( rect, rotation, horizontalAlignment, verticalAlignment, document, metrics, context, format , Qgis::TextComponent::Text, mode );
124
+ drawPart ( rect, rotation, horizontalAlignment, verticalAlignment, document, metrics, context, tmpFormat , Qgis::TextComponent::Text, mode );
124
125
}
125
126
126
127
void QgsTextRenderer::drawText ( QPointF point, double rotation, Qgis::TextHorizontalAlignment alignment, const QStringList &textLines, QgsRenderContext &context, const QgsTextFormat &format, bool )
0 commit comments