Skip to content
Permalink
Browse files

Fix incorrect label/diagram distance when map is rotated

(Cherry-picked from 873eb7f)
  • Loading branch information
nyalldawson committed Jul 8, 2016
1 parent c79f290 commit 02cc0cc3488b24d1ffe5619a58e10c513027ba00
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/qgspallabeling.cpp
  2. +1 −1 src/core/qgsvectorlayerdiagramprovider.cpp
@@ -2898,7 +2898,7 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, QgsRenderContext &cont
{
distance *= vectorScaleFactor;
}
double d = qAbs( ptOne.x() - ptZero.x() ) * distance;
double d = ptOne.distance( ptZero ) * distance;
( *labelFeature )->setDistLabel( d );
}

@@ -368,6 +368,6 @@ QgsLabelFeature* QgsVectorLayerDiagramProvider::registerDiagram( QgsFeature& fea

QgsPoint ptZero = mSettings.xform->toMapCoordinates( 0, 0 );
QgsPoint ptOne = mSettings.xform->toMapCoordinates( 1, 0 );
lf->setDistLabel( qAbs( ptOne.x() - ptZero.x() ) * mSettings.dist );
lf->setDistLabel( ptOne.distance( ptZero ) * mSettings.dist );
return lf;
}

0 comments on commit 02cc0cc

Please sign in to comment.
You can’t perform that action at this time.