Ignore:
Timestamp:
2015-02-19T15:22:49+01:00 (9 years ago)
Author:
bastiK
Message:

MapCSS: new @supports rule

Implementation should be mostly compatible with
the CSS Conditional 3 draft [2].

This is similar to @media, which was previously misused
for this purpose and is now deprecated.

refs:
[1] https://wiki.openstreetmap.org/wiki/MapCSS/0.2/Proposal_media_query
[2] http://dev.w3.org/csswg/css-conditional/

File:
1 edited

Legend:

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

    r7402 r8087  
    127127        float xOffset = 0;
    128128        float yOffset = 0;
    129         float[] offset = c.get("text-offset", null, float[].class);
     129        float[] offset = c.get(TEXT_OFFSET, null, float[].class);
    130130        if (offset != null) {
    131131            if (offset.length == 1) {
     
    136136            }
    137137        }
    138         xOffset = c.get("text-offset-x", xOffset, Float.class);
    139         yOffset = c.get("text-offset-y", yOffset, Float.class);
    140 
    141         Color color = c.get("text-color", defaultTextColor, Color.class);
    142         float alpha = c.get("text-opacity", 1f, Float.class);
     138        xOffset = c.get(TEXT_OFFSET_X, xOffset, Float.class);
     139        yOffset = c.get(TEXT_OFFSET_Y, yOffset, Float.class);
     140
     141        Color color = c.get(TEXT_COLOR, defaultTextColor, Color.class);
     142        float alpha = c.get(TEXT_OPACITY, 1f, Float.class);
    143143        color = new Color(color.getRed(), color.getGreen(),
    144144                color.getBlue(), Utils.color_float2int(alpha));
    145145
    146         Float haloRadius = c.get("text-halo-radius", null, Float.class);
     146        Float haloRadius = c.get(TEXT_HALO_RADIUS, null, Float.class);
    147147        if (haloRadius != null && haloRadius <= 0) {
    148148            haloRadius = null;
     
    150150        Color haloColor = null;
    151151        if (haloRadius != null) {
    152             haloColor = c.get("text-halo-color", Utils.complement(color), Color.class);
    153             float haloAlpha = c.get("text-halo-opacity", 1f, Float.class);
     152            haloColor = c.get(TEXT_HALO_COLOR, Utils.complement(color), Color.class);
     153            float haloAlpha = c.get(TEXT_HALO_OPACITY, 1f, Float.class);
    154154            haloColor = new Color(haloColor.getRed(), haloColor.getGreen(),
    155155                    haloColor.getBlue(), Utils.color_float2int(haloAlpha));
Note: See TracChangeset for help on using the changeset viewer.