Skip to content
Permalink
Browse files

Fix incorrect label/diagram distance when map is rotated

  • Loading branch information
nyalldawson committed Jul 8, 2016
1 parent 871ea87 commit 873eb7f90a271970a904b5d4a37740f91b24f941
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/qgspallabeling.cpp
  2. +1 −1 src/core/qgsvectorlayerdiagramprovider.cpp
@@ -2917,7 +2917,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 );
}

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

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

0 comments on commit 873eb7f

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