Skip to content

Commit

Permalink
Better snapping behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
leyan committed May 21, 2014
1 parent 2377f17 commit 4768a8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsmaptoolsplitfeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ void QgsMapToolSplitFeatures::canvasReleaseEvent( QMouseEvent * e )
{
QList<QgsSnappingResult> snapResults;

//If we snap the first point on a line layer, we directly split the feature at this point
//If we snap the first point on a vertex of a line layer, we directly split the feature at this point
if ( vlayer->geometryType() == QGis::Line && points().isEmpty() )
{
if ( mSnapper.snapToBackgroundLayers( e->pos(), snapResults ) == 0 )
if ( mSnapper.snapToCurrentLayer( e->pos(), snapResults, QgsSnapper::SnapToVertex ) == 0 )
{
if ( snapResults.size() > 0 )
{
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsmaptoolsplitparts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ void QgsMapToolSplitParts::canvasReleaseEvent( QMouseEvent * e )
{
QList<QgsSnappingResult> snapResults;

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

0 comments on commit 4768a8f

Please sign in to comment.