Skip to content
Permalink
Browse files
box of a more reasonable size for a single point
  • Loading branch information
leyan committed May 20, 2014
1 parent fb5ec3b commit a14744c53f6fdf8fb81027a43b897d8f34b769b9
Showing with 14 additions and 8 deletions.
  1. +14 −8 src/core/qgsvectorlayereditutils.cpp
@@ -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 );
}
}

@@ -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 );
}
}

0 comments on commit a14744c

Please sign in to comment.