Skip to content

Commit

Permalink
fix for bug where feature splitting was not possible if bounding box …
Browse files Browse the repository at this point in the history
…of split line was a line

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8100 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Feb 3, 2008
1 parent 5fcec96 commit bb008af
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -1722,7 +1722,21 @@ int QgsVectorLayer::splitFeatures(const QList<QgsPoint>& splitLine, bool topolog

if(bBox.isEmpty())
{
return 2;
//if the bbox is a line, try to make a square out of it
if(!bBox.width() > 0.0 && bBox.height() > 0)
{
bBox.setXmin(bBox.xMin() - bBox.height()/2);
bBox.setXmax(bBox.xMax() + bBox.height()/2);
}
else if(!bBox.height() > 0.0 && bBox.width() > 0)
{
bBox.setYmin(bBox.yMin() - bBox.width()/2);
bBox.setYmax(bBox.yMax() + bBox.width()/2);
}
else
{
return 2;
}
}
featuresInRectangle(bBox, featureList);
}
Expand Down

0 comments on commit bb008af

Please sign in to comment.