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)
(cherry-picked from aa4d65d)
  • Loading branch information
nyalldawson committed Nov 18, 2015
1 parent a1479a7 commit f98fd33
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/app/qgsmaptoolfillring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,14 @@ void QgsMapToolFillRing::canvasMapReleaseEvent( 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 f98fd33

Please sign in to comment.