Skip to content

Commit 8d364cb

Browse files
author
mhugent
committed
Fix for jumps if moving diagrams and labels with rotation point other than lower left
git-svn-id: http://svn.osgeo.org/qgis/trunk@15683 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9007d89 commit 8d364cb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/app/qgsmaptoolmovelabel.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@ void QgsMapToolMoveLabel::canvasPressEvent( QMouseEvent * e )
4949
if ( labelMoveable( layer, xCol, yCol ) || diagramMoveable( layer, xCol, yCol ) )
5050
{
5151
mStartPointMapCoords = toMapCoordinates( e->pos() );
52-
mClickOffsetX = mStartPointMapCoords.x() - mCurrentLabelPos.labelRect.xMinimum();
53-
mClickOffsetY = mStartPointMapCoords.y() - mCurrentLabelPos.labelRect.yMinimum();
52+
QgsPoint referencePoint;
53+
if ( !rotationPoint( referencePoint ) )
54+
{
55+
referencePoint.setX( mCurrentLabelPos.labelRect.xMinimum() );
56+
referencePoint.setY( mCurrentLabelPos.labelRect.yMinimum() );
57+
}
58+
mClickOffsetX = mStartPointMapCoords.x() - referencePoint.x();
59+
mClickOffsetY = mStartPointMapCoords.y() - referencePoint.y();
5460
createRubberBands();
5561
}
5662
}

0 commit comments

Comments
 (0)