Skip to content

Commit

Permalink
Fix fill ring tool used with advanced digitising crashes QGIS
Browse files Browse the repository at this point in the history
(fix #13355)
  • Loading branch information
nyalldawson committed Oct 8, 2015
1 parent 74f8d47 commit aa4d65d
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/app/qgsmaptoolfillring.cpp
Expand Up @@ -122,25 +122,14 @@ void QgsMapToolFillRing::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
yMin = std::numeric_limits<double>::max();
yMax = -std::numeric_limits<double>::max();

for ( QList<QgsPoint>::const_iterator it = points().constBegin(); it != points().constEnd(); ++it )
Q_FOREACH ( const QgsPoint& point, points() )
{
if ( it->x() < xMin )
{
xMin = it->x();
}
if ( it->x() > xMax )
{
xMax = it->x();
}
if ( it->y() < yMin )
{
yMin = it->y();
}
if ( it->y() > yMax )
{
yMax = it->y();
}
xMin = qMin( xMin, point.x() );
xMax = qMax( xMax, point.x() );
yMin = qMin( yMin, point.y() );
yMax = qMax( yMax, point.y() );
}

bBox.setXMinimum( xMin );
bBox.setYMinimum( yMin );
bBox.setXMaximum( xMax );
Expand Down

0 comments on commit aa4d65d

Please sign in to comment.