File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,15 @@ class QgsPalGeometry : public PalGeometry
110
110
int nxt = i + 1 ;
111
111
wordSpaceFix = ( nxt < mClusters .count () && mClusters [nxt] != QString ( " " ) ) ? mWordSpacing : qreal ( 0.0 );
112
112
}
113
- if ( fm->width ( QString ( mClusters [i] ) ) - fm->width ( mClusters [i] ) - mLetterSpacing != qreal ( 0.0 ) )
113
+ // this workaround only works for clusters with a single character. Not sure how it should be handled
114
+ // with multi-character clusters.
115
+ if ( mClusters [i].length () == 1 &&
116
+ !qgsDoubleNear ( fm->width ( QString ( mClusters [i].at ( 0 ) ) ), fm->width ( mClusters [i].at ( 0 ) ) + mLetterSpacing ) )
114
117
{
115
118
// word spacing applied when it shouldn't be
116
119
wordSpaceFix -= mWordSpacing ;
117
120
}
121
+
118
122
charWidth = fm->width ( QString ( mClusters [i] ) ) + wordSpaceFix;
119
123
}
120
124
@@ -165,10 +169,10 @@ class QgsPalGeometry : public PalGeometry
165
169
qreal mLetterSpacing ; // for use with curved labels
166
170
qreal mWordSpacing ; // for use with curved labels
167
171
bool mCurvedLabeling ; // whether the geometry is to be used for curved labeling placement
168
- /* *Stores attribute values for data defined properties*/
172
+ /* * Stores attribute values for data defined properties*/
169
173
QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > mDataDefinedValues ;
170
174
171
- /* *Stores attribute values for diagram rendering*/
175
+ /* * Stores attribute values for diagram rendering*/
172
176
QgsAttributes mDiagramAttributes ;
173
177
174
178
QString mDxfLayer ;
You can’t perform that action at this time.
0 commit comments