Changeset 15036 in josm
- Timestamp:
- 2019-05-02T08:54:58+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r15035 r15036 1156 1156 double distance = getDistance(osm, primitive); 1157 1157 if (Double.isNaN(distance)) continue; 1158 if (distance < lowestDistance) { 1158 int comp = Double.compare(distance, lowestDistance); 1159 if (comp < 0) { 1159 1160 closest.clear(); 1160 1161 lowestDistance = distance; 1161 1162 closest.add(primitive); 1162 } else if ( distance == lowestDistance) {1163 } else if (comp == 0) { 1163 1164 closest.add(primitive); 1164 1165 } … … 1219 1220 double distance = getDistance(osm, primitive); 1220 1221 if (Double.isNaN(distance)) continue; 1221 if (distance > furthestDistance) { 1222 int comp = Double.compare(distance, furthestDistance); 1223 if (comp > 0) { 1222 1224 furthest.clear(); 1223 1225 furthestDistance = distance; 1224 1226 furthest.add(primitive); 1225 } else if ( distance == furthestDistance) {1227 } else if (comp == 0) { 1226 1228 furthest.add(primitive); 1227 1229 }
Note:
See TracChangeset
for help on using the changeset viewer.