Ignore:
Timestamp:
2015-04-25T14:00:05+02:00 (9 years ago)
Author:
bastiK
Message:

see #10217 - move unit handling to parser
adds support for negative angles
new: length units px,cm,mm,in,q,pc,pt as in CSS (immediately converted to px)

File:
1 edited

Legend:

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

    r8238 r8260  
    120120            symbol = createSymbol(env);
    121121        }
    122         final String rotationString = c.get("icon-rotation", null, String.class);
    123122        RotationAngle rotationAngle = null;
    124         if ("way".equalsIgnoreCase(rotationString)) {
    125             rotationAngle = RotationAngle.buildWayDirectionRotation();
    126         } else if (rotationString != null) {
    127             try {
    128                 rotationAngle = RotationAngle.buildStaticRotation(rotationString);
    129             } catch (RuntimeException ignore) {
     123        final Float angle = c.get(ICON_ROTATION, null, Float.class, true);
     124        if (angle != null) {
     125            rotationAngle = RotationAngle.buildStaticRotation(angle);
     126        } else {
     127            final Keyword rotationKW = c.get(ICON_ROTATION, null, Keyword.class);
     128            if (rotationKW != null) {
     129                if ("way".equals(rotationKW.val)) {
     130                    rotationAngle = RotationAngle.buildWayDirectionRotation();
     131                } else {
     132                    try {
     133                        rotationAngle = RotationAngle.buildStaticRotation(rotationKW.val);
     134                    } catch (IllegalArgumentException ignore) {
     135                    }
     136                }
    130137            }
    131138        }
Note: See TracChangeset for help on using the changeset viewer.