Changeset 3859 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2011-02-05T19:47:07+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
r3858 r3859 100 100 } 101 101 102 public void drawWay(Way way, Color color, float width, float dashed[], Color dashedColor, boolean showDirection,102 public void drawWay(Way way, Color color, float width, float dashed[], float dashesOffset, Color dashedColor, boolean showDirection, 103 103 boolean reversedDirection, boolean showHeadArrowOnly) { 104 104 … … 156 156 lastPoint = p; 157 157 } 158 displaySegments(path, arrows, color, width, dashed, dashe dColor);159 } 160 161 private void displaySegments(GeneralPath path, GeneralPath arrows, Color color, float width, float dashed[], Color dashedColor) {158 displaySegments(path, arrows, color, width, dashed, dashesOffset, dashedColor); 159 } 160 161 private void displaySegments(GeneralPath path, GeneralPath arrows, Color color, float width, float dashed[], float dashesOffset, Color dashedColor) { 162 162 g.setColor(inactive ? inactiveColor : color); 163 163 if (useStrokes) { 164 164 if (dashed != null && dashed.length > 0) { 165 g.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0, dashed,0));165 g.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,dashed,dashesOffset)); 166 166 } else { 167 167 g.setStroke(new BasicStroke(width,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND)); … … 175 175 if (dashed != null && dashed.length > 0) { 176 176 float[] dashedOffset = new float[dashed.length]; 177 System.arraycopy(dashed, 1, dashedOffset, 0, dashed.length - 1);178 dashedOffset[ dashed.length-1] = dashed[0];179 float offset = dashedOffset[0] ;180 g.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,dashedOffset, offset));177 System.arraycopy(dashed, 0, dashedOffset, 1, dashed.length - 1); 178 dashedOffset[0] = dashed[dashed.length-1]; 179 float offset = dashedOffset[0] + dashesOffset; 180 g.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,dashedOffset, offset)); 181 181 } else { 182 182 g.setStroke(new BasicStroke(width,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
Note:
See TracChangeset
for help on using the changeset viewer.