Skip to content

Commit

Permalink
box of a more reasonable size for a single point
Browse files Browse the repository at this point in the history
  • Loading branch information
leyan committed May 20, 2014
1 parent fb5ec3b commit a14744c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/core/qgsvectorlayereditutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,13 @@ int QgsVectorLayerEditUtils::splitFeatures( const QList<QgsPoint>& splitLine, bo
else
{
//If we have a single point, we still create a non-null box
bBox.setXMinimum( bBox.xMinimum() - 1 );
bBox.setXMaximum( bBox.xMaximum() + 1 );
bBox.setYMinimum( bBox.yMinimum() - 1 );
bBox.setYMaximum( bBox.yMaximum() + 1 );
double bufferDistance = 0.000001;
if ( L->crs().geographicFlag() )
bufferDistance = 0.00000001;
bBox.setXMinimum( bBox.xMinimum() - bufferDistance );
bBox.setXMaximum( bBox.xMaximum() + bufferDistance );
bBox.setYMinimum( bBox.yMinimum() - bufferDistance );
bBox.setYMaximum( bBox.yMaximum() + bufferDistance );
}
}

Expand Down Expand Up @@ -367,10 +370,13 @@ int QgsVectorLayerEditUtils::splitParts( const QList<QgsPoint>& splitLine, bool
else
{
//If we have a single point, we still create a non-null box
bBox.setXMinimum( bBox.xMinimum() - 1 );
bBox.setXMaximum( bBox.xMaximum() + 1 );
bBox.setYMinimum( bBox.yMinimum() - 1 );
bBox.setYMaximum( bBox.yMaximum() + 1 );
double bufferDistance = 0.000001;
if ( L->crs().geographicFlag() )
bufferDistance = 0.00000001;
bBox.setXMinimum( bBox.xMinimum() - bufferDistance );
bBox.setXMaximum( bBox.xMaximum() + bufferDistance );
bBox.setYMinimum( bBox.yMinimum() - bufferDistance );
bBox.setYMaximum( bBox.yMaximum() + bufferDistance );
}
}

Expand Down

0 comments on commit a14744c

Please sign in to comment.