mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[labeling] Fix incorrect handling of word spacing for curved labels
This commit is contained in:
parent
a1a8d1b7a3
commit
c8dcf97e97
@ -110,11 +110,15 @@ class QgsPalGeometry : public PalGeometry
|
||||
int nxt = i + 1;
|
||||
wordSpaceFix = ( nxt < mClusters.count() && mClusters[nxt] != QString( " " ) ) ? mWordSpacing : qreal( 0.0 );
|
||||
}
|
||||
if ( fm->width( QString( mClusters[i] ) ) - fm->width( mClusters[i] ) - mLetterSpacing != qreal( 0.0 ) )
|
||||
// this workaround only works for clusters with a single character. Not sure how it should be handled
|
||||
// with multi-character clusters.
|
||||
if ( mClusters[i].length() == 1 &&
|
||||
!qgsDoubleNear( fm->width( QString( mClusters[i].at( 0 ) ) ), fm->width( mClusters[i].at( 0 ) ) + mLetterSpacing ) )
|
||||
{
|
||||
// word spacing applied when it shouldn't be
|
||||
wordSpaceFix -= mWordSpacing;
|
||||
}
|
||||
|
||||
charWidth = fm->width( QString( mClusters[i] ) ) + wordSpaceFix;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user