Changeset 7472 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2014-08-30T20:21:05+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r7471 r7472 1062 1062 // find half segments that are long enough to draw text on 1063 1063 // (don't draw text over the cross hair in the center of each segment) 1064 List<Double> longHalfSegmentS art = new ArrayList<>(); // start point of half segment (as length along the way)1064 List<Double> longHalfSegmentStart = new ArrayList<>(); // start point of half segment (as length along the way) 1065 1065 List<Double> longHalfSegmentEnd = new ArrayList<>(); // end point of half segment (as length along the way) 1066 1066 List<Double> longHalfsegmentQuality = new ArrayList<>(); // quality factor (off screen / partly on screen / fully on screen) … … 1085 1085 } 1086 1086 } 1087 longHalfSegmentS art.add(pathLength);1087 longHalfSegmentStart.add(pathLength); 1088 1088 longHalfSegmentEnd.add(pathLength + segmentLength / 2); 1089 1089 longHalfsegmentQuality.add(q); … … 1097 1097 } 1098 1098 } 1099 longHalfSegmentS art.add(pathLength + segmentLength / 2);1099 longHalfSegmentStart.add(pathLength + segmentLength / 2); 1100 1100 longHalfSegmentEnd.add(pathLength + segmentLength); 1101 1101 longHalfsegmentQuality.add(q); … … 1111 1111 double t1, t2; 1112 1112 1113 if (!longHalfSegmentS art.isEmpty()) {1113 if (!longHalfSegmentStart.isEmpty()) { 1114 1114 if (way.getNodesCount() == 2) { 1115 1115 // For 2 node ways, the two half segments are exactly … … 1125 1125 double bestDistanceToCenter = Double.MAX_VALUE; 1126 1126 double bestQuality = -1; 1127 for (int i=0; i<longHalfSegmentS art.size(); i++) {1128 double start = longHalfSegmentS art.get(i);1127 for (int i=0; i<longHalfSegmentStart.size(); i++) { 1128 double start = longHalfSegmentStart.get(i); 1129 1129 double end = longHalfSegmentEnd.get(i); 1130 1130 double dist = Math.abs(0.5 * (end + start) - 0.5 * pathLength);
Note:
See TracChangeset
for help on using the changeset viewer.