Skip to content

Commit 6c467fb

Browse files
committed
Fix snap to grid with differing layer CRS
1 parent 1e81e03 commit 6c467fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gui/qgsmapmouseevent.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ void QgsMapMouseEvent::snapToGrid( double precision, const QgsCoordinateReferenc
8080

8181
QgsPointXY pt = ct.transform( mMapPoint );
8282

83-
pt.setX( std::round( mMapPoint.x() / precision ) * precision );
84-
pt.setY( std::round( mMapPoint.y() / precision ) * precision );
83+
pt.setX( std::round( pt.x() / precision ) * precision );
84+
pt.setY( std::round( pt.y() / precision ) * precision );
8585

8686
pt = ct.transform( pt, QgsCoordinateTransform::ReverseTransform );
8787

0 commit comments

Comments
 (0)