Skip to content

Commit 7ecd98b

Browse files
author
wonder
committedJul 22, 2009
Fixed for simplify tool, show a message if the feature can't be simplified.
By Richard Kostecky. git-svn-id: http://svn.osgeo.org/qgis/trunk@11144 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0054b7a commit 7ecd98b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/app/qgsmaptoolsimplify.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ bool QgsMapToolSimplify::calculateSliderBoudaries()
153153
bool isLine = mSelectedFeature.geometry()->type() == QGis::Line;
154154
QVector<QgsPoint> pts = getPointList( mSelectedFeature );
155155
int size = pts.size();
156-
if ( size == 0 || ( isLine && size < 2 ) || ( !isLine && size < 4 ) )
156+
if ( size == 0 || ( isLine && size <= 2 ) || ( !isLine && size <= 4 ) )
157157
{
158158
return false;
159159
}
@@ -294,6 +294,10 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )
294294
// show dialog as a non-modal window
295295
mSimplifyDialog->show();
296296
}
297+
else
298+
{
299+
QMessageBox::warning( 0, tr( "Unsupported operation" ), tr( "This feature cannot be simplified. Check if feature has enough vertices to be simplified." ) );
300+
}
297301
}
298302
}
299303

0 commit comments

Comments
 (0)
Please sign in to comment.