@@ -777,7 +777,8 @@ void QgsComposerMouseHandles::dragMouseMove( const QPointF& currentPosition, boo
777
777
QPointF upperLeftPoint ( mBeginHandlePos .x () + moveX, mBeginHandlePos .y () + moveY );
778
778
779
779
QPointF snappedLeftPoint;
780
- if ( !preventSnap )
780
+ // no snapping for rotated items for now
781
+ if ( !preventSnap && rotation () == 0 )
781
782
{
782
783
// snap to grid and guides
783
784
snappedLeftPoint = snapPoint ( upperLeftPoint, QgsComposerMouseHandles::Item );
@@ -825,14 +826,27 @@ void QgsComposerMouseHandles::resizeMouseMove( const QPointF& currentPosition, b
825
826
826
827
double mx = 0.0 , my = 0.0 , rx = 0.0 , ry = 0.0 ;
827
828
828
- // subtract cursor edge offset from begin mouse event and current cursor position, so that snapping occurs to edge of mouse handles
829
- // rather then cursor position
830
- QPointF beginMousePos = mapFromScene ( QPointF ( mBeginMouseEventPos .x () - mCursorOffset .width (), mBeginMouseEventPos .y () - mCursorOffset .height () ) );
831
- QPointF snappedPosition = snapPoint ( QPointF ( currentPosition.x () - mCursorOffset .width (), currentPosition.y () - mCursorOffset .height () ), QgsComposerMouseHandles::Point );
832
- snappedPosition = mapFromScene ( snappedPosition );
829
+ QPointF beginMousePos;
830
+ QPointF finalPosition;
831
+ if ( rotation () == 0 )
832
+ {
833
+ // snapping only occurs if handles are not rotated for now
834
+
835
+ // subtract cursor edge offset from begin mouse event and current cursor position, so that snapping occurs to edge of mouse handles
836
+ // rather then cursor position
837
+ beginMousePos = mapFromScene ( QPointF ( mBeginMouseEventPos .x () - mCursorOffset .width (), mBeginMouseEventPos .y () - mCursorOffset .height () ) );
838
+ QPointF snappedPosition = snapPoint ( QPointF ( currentPosition.x () - mCursorOffset .width (), currentPosition.y () - mCursorOffset .height () ), QgsComposerMouseHandles::Point );
839
+ finalPosition = mapFromScene ( snappedPosition );
840
+ }
841
+ else
842
+ {
843
+ // no snapping for rotated items for now
844
+ beginMousePos = mapFromScene ( mBeginMouseEventPos );
845
+ finalPosition = mapFromScene ( currentPosition );
846
+ }
833
847
834
- double diffX = snappedPosition .x () - beginMousePos.x ();
835
- double diffY = snappedPosition .y () - beginMousePos.y ();
848
+ double diffX = finalPosition .x () - beginMousePos.x ();
849
+ double diffY = finalPosition .y () - beginMousePos.y ();
836
850
837
851
double ratio = 0 ;
838
852
if ( lockRatio && mBeginHandleHeight != 0 )
0 commit comments