From a739750e456c8d5387798b770aad65f7d0728364 Mon Sep 17 00:00:00 2001 From: Nathan Woodrow Date: Fri, 28 Oct 2011 23:20:58 +1000 Subject: [PATCH] Fix multiline overlap - Fix for #4454 --- src/core/qgspallabeling.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index 98bca686377..9d9a174234d 100644 --- a/src/core/qgspallabeling.cpp +++ b/src/core/qgspallabeling.cpp @@ -434,10 +434,11 @@ void QgsPalLayerSettings::calculateLabelSize( const QFontMetricsF* fm, QString t { text.append( ">" ); } - QRectF labelRect = fm->boundingRect( text ); + double w, h; if ( !multiLineLabels ) { + QRectF labelRect = fm->boundingRect( text ); w = labelRect.width() / rasterCompressFactor; h = labelRect.height() / rasterCompressFactor; } @@ -452,9 +453,9 @@ void QgsPalLayerSettings::calculateLabelSize( const QFontMetricsF* fm, QString t if ( width > w ) { w = width; - } - w /= rasterCompressFactor; + } } + w /= rasterCompressFactor; } QgsPoint ptSize = xform->toMapCoordinatesF( w, h );