Skip to content

Commit

Permalink
Fix incorrect label/diagram distance when map is rotated
Browse files Browse the repository at this point in the history
(Cherry-picked from 873eb7f)
  • Loading branch information
nyalldawson committed Jul 8, 2016
1 parent c79f290 commit 02cc0cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/qgspallabeling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayerdiagramprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.