Skip to content

Commit 4768a8f

Browse files
committed
Better snapping behavior
1 parent 2377f17 commit 4768a8f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app/qgsmaptoolsplitfeatures.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ void QgsMapToolSplitFeatures::canvasReleaseEvent( QMouseEvent * e )
5858
{
5959
QList<QgsSnappingResult> snapResults;
6060

61-
//If we snap the first point on a line layer, we directly split the feature at this point
61+
//If we snap the first point on a vertex of a line layer, we directly split the feature at this point
6262
if ( vlayer->geometryType() == QGis::Line && points().isEmpty() )
6363
{
64-
if ( mSnapper.snapToBackgroundLayers( e->pos(), snapResults ) == 0 )
64+
if ( mSnapper.snapToCurrentLayer( e->pos(), snapResults, QgsSnapper::SnapToVertex ) == 0 )
6565
{
6666
if ( snapResults.size() > 0 )
6767
{

src/app/qgsmaptoolsplitparts.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ void QgsMapToolSplitParts::canvasReleaseEvent( QMouseEvent * e )
5656
{
5757
QList<QgsSnappingResult> snapResults;
5858

59-
//If we snap the first point on a line layer, we directly split the feature at this point
59+
//If we snap the first point on a vertex of a line layer, we directly split the feature at this point
6060
if ( vlayer->geometryType() == QGis::Line && points().isEmpty() )
6161
{
62-
if ( mSnapper.snapToBackgroundLayers( e->pos(), snapResults ) == 0 )
62+
if ( mSnapper.snapToCurrentLayer( e->pos(), snapResults, QgsSnapper::SnapToVertex ) == 0 )
6363
{
6464
if ( snapResults.size() > 0 )
6565
{

0 commit comments

Comments
 (0)