Ignore:
Timestamp:
2017-03-05T17:31:39+01:00 (7 years ago)
Author:
michael2402
Message:

Repsect alpha component of mapcss text/halo color, use opacity to multiply.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextLabel.java

    r10748 r11692  
    146146        Color color = c.get(TEXT_COLOR, defaultTextColor, Color.class);
    147147        float alpha = c.get(TEXT_OPACITY, 1f, Float.class);
    148         color = new Color(color.getRed(), color.getGreen(),
    149                 color.getBlue(), Utils.colorFloat2int(alpha));
     148        color = Utils.alphaMultiply(color, alpha);
    150149
    151150        Float haloRadius = c.get(TEXT_HALO_RADIUS, null, Float.class);
     
    156155        if (haloRadius != null) {
    157156            haloColor = c.get(TEXT_HALO_COLOR, Utils.complement(color), Color.class);
    158             float haloAlpha = c.get(TEXT_HALO_OPACITY, 1f, Float.class);
    159             haloColor = new Color(haloColor.getRed(), haloColor.getGreen(),
    160                     haloColor.getBlue(), Utils.colorFloat2int(haloAlpha));
     157            float haloAlphaFactor = c.get(TEXT_HALO_OPACITY, 1f, Float.class);
     158            haloColor = Utils.alphaMultiply(haloColor, haloAlphaFactor);
    161159        }
    162160
Note: See TracChangeset for help on using the changeset viewer.