Ignore:
Timestamp:
2020-06-21T18:53:41+02:00 (4 years ago)
Author:
simon04
Message:

fix #18213 - MapCSS: add support for repeat-image-opacity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r16393 r16700  
    66import java.awt.Color;
    77import java.awt.Component;
     8import java.awt.Composite;
    89import java.awt.Dimension;
    910import java.awt.Font;
     
    682683     * @param spacing spacing between two images
    683684     * @param phase initial spacing
     685     * @param opacity the opacity
    684686     * @param align alignment of the image. The top, center or bottom edge can be aligned with the way.
    685687     */
    686688    public void drawRepeatImage(IWay<?> way, MapImage pattern, boolean disabled, double offset, double spacing, double phase,
    687             LineImageAlignment align) {
     689                                float opacity, LineImageAlignment align) {
    688690        final int imgWidth = pattern.getWidth();
    689691        final double repeat = imgWidth + spacing;
     
    730732                int sx1 = Math.max(0, -x);
    731733                int sx2 = imgWidth - Math.max(0, x + imgWidth - (int) Math.ceil(segmentLength));
     734                Composite saveComposite = g.getComposite();
     735                g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, opacity));
    732736                g.drawImage(image, x + sx1, dy1, x + sx2, dy2, sx1, 0, sx2, imgHeight, null);
     737                g.setComposite(saveComposite);
    733738                imageStart += repeat;
    734739            }
Note: See TracChangeset for help on using the changeset viewer.