mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
box of a more reasonable size for a single point
This commit is contained in:
parent
fb5ec3bc96
commit
a14744c53f
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user