- Timestamp:
- 2016-09-04T02:29:18+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r10942 r10953 34 34 import java.util.Map; 35 35 import java.util.NoSuchElementException; 36 import java.util.Optional; 36 37 import java.util.concurrent.ForkJoinPool; 37 38 import java.util.concurrent.ForkJoinTask; … … 1286 1287 if (!longHalfSegment.isEmpty()) { 1287 1288 // find the segment with the best quality. If there are several with best quality, the one close to the center is prefered. 1288 HalfSegment best= longHalfSegment.stream().max(1289 Optional<HalfSegment> besto = longHalfSegment.stream().max( 1289 1290 Comparator.comparingDouble(segment -> 1290 1291 segment.quality - 1e-5 * Math.abs(0.5 * (segment.end + segment.start) - 0.5 * pathLength) 1291 )).get(); 1292 )); 1293 if (!besto.isPresent()) 1294 throw new IllegalStateException("Unable to find the segment with the best quality for " + way); 1295 HalfSegment best = besto.get(); 1292 1296 double remaining = best.end - best.start - rec.getWidth(); // total space left and right from the text 1293 1297 // The space left and right of the text should be distributed 20% - 80% (towards the center),
Note:
See TracChangeset
for help on using the changeset viewer.