mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-06 00:05:16 -04:00
Fixed a segfault with simplify tool (#2450)
git-svn-id: http://svn.osgeo.org/qgis/trunk@13176 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
26f4b4513e
commit
a066fe33eb
@ -259,7 +259,7 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )
|
||||
vlayer->select( QgsAttributeList(), selectRect, true );
|
||||
|
||||
QgsGeometry* geometry = QgsGeometry::fromPoint( layerCoords );
|
||||
double minDistance = 10000000;
|
||||
double minDistance = DBL_MAX;
|
||||
double currentDistance;
|
||||
QgsFeature f;
|
||||
|
||||
@ -274,16 +274,18 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )
|
||||
mSelectedFeature = f;
|
||||
}
|
||||
}
|
||||
if ( mSelectedFeature.geometry()->isMultipart() )
|
||||
{
|
||||
QMessageBox::critical( 0, tr( "Unsupported operation" ), tr( "Multipart features are not supported for simplification." ) );
|
||||
return;
|
||||
}
|
||||
|
||||
// delete previous rubberband (if any)
|
||||
removeRubberBand();
|
||||
|
||||
if ( mSelectedFeature.isValid() )
|
||||
{
|
||||
if ( mSelectedFeature.geometry()->isMultipart() )
|
||||
{
|
||||
QMessageBox::critical( 0, tr( "Unsupported operation" ), tr( "Multipart features are not supported for simplification." ) );
|
||||
return;
|
||||
}
|
||||
|
||||
mRubberBand = new QgsRubberBand( mCanvas );
|
||||
mRubberBand->setToGeometry( mSelectedFeature.geometry(), false );
|
||||
mRubberBand->setColor( Qt::red );
|
||||
|
Loading…
x
Reference in New Issue
Block a user