- myMinU = myMaxU = (thePoints[0]).x;
- myMinV = myMaxV = (thePoints[0]).y;
- double x, y;
-
- for (int i = 1; i < thePoints.size(); i++) {
- x = (thePoints[i]).x;
- y = (thePoints[i]).y;
-
- if (myMinU > x)
- myMinU = x;
- if (myMaxU < x)
- myMaxU = x;
- if (myMinV > y)
- myMinV = y;
- if (myMaxV < y)
- myMaxV = y;
+ myMinU = myMaxU = myPoints[0].x;
+ myMinV = myMaxV = myPoints[0].y;
+
+ for ( int i = 1; i < myPoints.size(); i++ ) {
+ myMinU = qMin( myPoints[i].x, myMinU );
+ myMaxU = qMax( myPoints[i].x, myMaxU );
+ myMinV = qMin( myPoints[i].y, myMinV );
+ myMaxV = qMax( myPoints[i].y, myMaxV );