Skip to content

Commit 3117333

Browse files
committed
Fix incorrect calculation of priority for diagrams (fix #4692)
1 parent 15b6043 commit 3117333

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/qgspallabeling.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -3382,7 +3382,8 @@ int QgsPalLabeling::prepareLayer( QgsVectorLayer* layer, QStringList& attrNames,
33823382

33833383
int QgsPalLabeling::addDiagramLayer( QgsVectorLayer* layer, const QgsDiagramLayerSettings *s )
33843384
{
3385-
Layer* l = mPal->addLayer( layer->id().append( "d" ).toUtf8().data(), -1, -1, pal::Arrangement( s->placement ), METER, s->priority, s->obstacle, true, true );
3385+
double priority = 1 - s->priority / 10.0; // convert 0..10 --> 1..0
3386+
Layer* l = mPal->addLayer( layer->id().append( "d" ).toUtf8().data(), -1, -1, pal::Arrangement( s->placement ), METER, priority, s->obstacle, true, true );
33863387
l->setArrangementFlags( s->placementFlags );
33873388

33883389
mActiveDiagramLayers.insert( layer->id(), *s );

0 commit comments

Comments
 (0)