File tree Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -122,25 +122,14 @@ void QgsMapToolFillRing::canvasMapReleaseEvent( QgsMapMouseEvent * e )
122
122
yMin = std::numeric_limits<double >::max ();
123
123
yMax = -std::numeric_limits<double >::max ();
124
124
125
- for ( QList< QgsPoint>::const_iterator it = points (). constBegin (); it != points (). constEnd (); ++it )
125
+ Q_FOREACH ( const QgsPoint& point, points () )
126
126
{
127
- if ( it->x () < xMin )
128
- {
129
- xMin = it->x ();
130
- }
131
- if ( it->x () > xMax )
132
- {
133
- xMax = it->x ();
134
- }
135
- if ( it->y () < yMin )
136
- {
137
- yMin = it->y ();
138
- }
139
- if ( it->y () > yMax )
140
- {
141
- yMax = it->y ();
142
- }
127
+ xMin = qMin ( xMin, point.x () );
128
+ xMax = qMax ( xMax, point.x () );
129
+ yMin = qMin ( yMin, point.y () );
130
+ yMax = qMax ( yMax, point.y () );
143
131
}
132
+
144
133
bBox.setXMinimum ( xMin );
145
134
bBox.setYMinimum ( yMin );
146
135
bBox.setXMaximum ( xMax );
You can’t perform that action at this time.
0 commit comments