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 @@ -117,11 +117,15 @@ class QgsPalGeometry : public PalGeometry
117
117
int nxt = i + 1 ;
118
118
wordSpaceFix = ( nxt < mClusters .count () && mClusters [nxt] != QString ( " " ) ) ? mWordSpacing : qreal ( 0.0 );
119
119
}
120
- if ( fm->width ( QString ( mClusters [i] ) ) - fm->width ( mClusters [i] ) - mLetterSpacing != qreal ( 0.0 ) )
120
+ // this workaround only works for clusters with a single character. Not sure how it should be handled
121
+ // with multi-character clusters.
122
+ if ( mClusters [i].length () == 1 &&
123
+ !qgsDoubleNear ( fm->width ( QString ( mClusters [i].at ( 0 ) ) ), fm->width ( mClusters [i].at ( 0 ) ) + mLetterSpacing ) )
121
124
{
122
125
// word spacing applied when it shouldn't be
123
126
wordSpaceFix -= mWordSpacing ;
124
127
}
128
+
125
129
charWidth = fm->width ( QString ( mClusters [i] ) ) + wordSpaceFix;
126
130
}
127
131
@@ -172,10 +176,10 @@ class QgsPalGeometry : public PalGeometry
172
176
qreal mLetterSpacing ; // for use with curved labels
173
177
qreal mWordSpacing ; // for use with curved labels
174
178
bool mCurvedLabeling ; // whether the geometry is to be used for curved labeling placement
175
- /* *Stores attribute values for data defined properties*/
179
+ /* * Stores attribute values for data defined properties*/
176
180
QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > mDataDefinedValues ;
177
181
178
- /* *Stores attribute values for diagram rendering*/
182
+ /* * Stores attribute values for diagram rendering*/
179
183
QgsAttributes mDiagramAttributes ;
180
184
181
185
QString mDxfLayer ;
You can’t perform that action at this time.
0 commit comments