Changeset 16700 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
- Timestamp:
- 2020-06-21T18:53:41+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
r16630 r16700 67 67 public float phase; 68 68 /** 69 * The opacity 70 */ 71 public float opacity; 72 /** 69 73 * The alignment of the image 70 74 */ … … 81 85 * @param spacing The space between the images 82 86 * @param phase The offset of the first image along the way 87 * @param opacity The opacity 83 88 * @param align The alignment of the image 84 89 */ 85 public RepeatImageElement(Cascade c, MapImage pattern, float offset, float spacing, float phase, LineImageAlignment align) { 90 public RepeatImageElement(Cascade c, MapImage pattern, float offset, float spacing, float phase, float opacity, LineImageAlignment align) { 86 91 super(c, 2.9f); 87 92 CheckParameterUtil.ensureParameterNotNull(pattern); … … 91 96 this.spacing = spacing; 92 97 this.phase = phase; 98 this.opacity = opacity; 93 99 this.align = align; 94 100 } … … 107 113 float spacing = c.get(REPEAT_IMAGE_SPACING, 0f, Float.class); 108 114 float phase = -c.get(REPEAT_IMAGE_PHASE, 0f, Float.class); 115 float opacity = c.get(REPEAT_IMAGE_OPACITY, 1f, Float.class); 109 116 110 117 LineImageAlignment align = LineImageAlignment.CENTER; … … 116 123 } 117 124 118 return new RepeatImageElement(c, pattern, offset, spacing, phase, align); 125 return new RepeatImageElement(c, pattern, offset, spacing, phase, opacity, align); 119 126 } 120 127 … … 124 131 if (primitive instanceof IWay) { 125 132 IWay<?> w = (IWay<?>) primitive; 126 painter.drawRepeatImage(w, pattern, painter.isInactiveMode() || w.isDisabled(), offset, spacing, phase, align); 133 painter.drawRepeatImage(w, pattern, painter.isInactiveMode() || w.isDisabled(), offset, spacing, phase, opacity, align); 127 134 } 128 135 } … … 148 155 @Override 149 156 public int hashCode() { 150 return Objects.hash(super.hashCode(), pattern, offset, spacing, phase, align); 157 return Objects.hash(super.hashCode(), pattern, offset, spacing, phase, opacity, align); 151 158 } 152 159 … … 155 162 return "RepeatImageStyle{" + super.toString() + "pattern=[" + pattern + 156 163 "], offset=" + offset + ", spacing=" + spacing + 157 ", phase=" + -phase + ", align=" + align + '}'; 164 ", phase=" + -phase + ", opacity=" + opacity + ", align=" + align + '}'; 158 165 } 159 166 }
Note:
See TracChangeset
for help on using the changeset viewer.
