Changeset 4316 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2011-08-13T19:51:31+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r4305 r4316 33 33 public Color color; 34 34 public Color dashesBackground; 35 public int offset; 35 36 public float realWidth; // the real width of this line in meter 36 37 37 38 private BasicStroke dashesLine; 38 39 39 protected LineElemStyle(Cascade c, BasicStroke line, Color color, BasicStroke dashesLine, Color dashesBackground, float realWidth) {40 protected LineElemStyle(Cascade c, BasicStroke line, Color color, BasicStroke dashesLine, Color dashesBackground, int offset, float realWidth) { 40 41 super(c, 0f); 41 42 this.line = line; … … 43 44 this.dashesLine = dashesLine; 44 45 this.dashesBackground = dashesBackground; 46 this.offset = offset; 45 47 this.realWidth = realWidth; 46 48 } … … 175 177 BasicStroke dashesLine = null; 176 178 179 float offset = c.get("offset", 0f, Float.class); 180 177 181 if (dashes != null && dashesBackground != null) { 178 182 float[] dashes2 = new float[dashes.length]; … … 182 186 } 183 187 184 return new LineElemStyle(c, line, color, dashesLine, dashesBackground, realWidth);188 return new LineElemStyle(c, line, color, dashesLine, dashesBackground, (int) offset, realWidth); 185 189 } 186 190 … … 228 232 } 229 233 230 painter.drawWay(w, myColor, myLine, myDashLine, myDashedColor, showOrientation,234 painter.drawWay(w, myColor, myLine, myDashLine, myDashedColor, offset, showOrientation, 231 235 showOnlyHeadArrowOnly, showOneway, onewayReversed); 232 236 … … 260 264 equal(dashesLine, other.dashesLine) && 261 265 equal(dashesBackground, other.dashesBackground) && 266 offset == other.offset && 262 267 realWidth == other.realWidth; 263 268 } … … 270 275 hash = 29 * hash + (dashesLine != null ? dashesLine.hashCode() : 0); 271 276 hash = 29 * hash + (dashesBackground != null ? dashesBackground.hashCode() : 0); 277 hash = 29 * hash + offset; 272 278 hash = 29 * hash + Float.floatToIntBits(realWidth); 273 279 return hash; … … 283 289 " linejoin=" + linejoinToString(line.getLineJoin()) + 284 290 " linecap=" + linecapToString(line.getEndCap()) + 291 (offset == 0 ? "" : " offset=" + offset) + 285 292 '}'; 286 293 }
Note:
See TracChangeset
for help on using the changeset viewer.