Changeset 4281 in josm


Ignore:
Timestamp:
Aug 5, 2011 11:59:55 PM (22 months ago)
Author:
bastiK
Message:

mapcss: minor bugfix

Location:
trunk/src/org/openstreetmap/josm/gui/mappaint
Files:
3 edited

Legend:

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

    r4169 r4281  
    280280            " dashed=" + Arrays.toString(line.getDashArray()) + 
    281281            (line.getDashPhase() == 0f ? "" : " dashesOffses=" + line.getDashPhase()) + 
    282             " dashedColor=" + Utils.toString(dashesBackground) + '}'; 
     282            " dashedColor=" + Utils.toString(dashesBackground) + 
     283            " linejoin=" + linejoinToString(line.getLineJoin()) + 
     284            " linecap=" + linecapToString(line.getEndCap()) + 
     285            '}'; 
     286    } 
     287     
     288    public String linejoinToString(int linejoin) { 
     289        switch (linejoin) { 
     290            case BasicStroke.JOIN_BEVEL: return "bevel"; 
     291            case BasicStroke.JOIN_ROUND: return "round"; 
     292            case BasicStroke.JOIN_MITER: return "miter"; 
     293            default: return null; 
     294        } 
     295    } 
     296    public String linecapToString(int linecap) { 
     297        switch (linecap) { 
     298            case BasicStroke.CAP_BUTT: return "none"; 
     299            case BasicStroke.CAP_ROUND: return "round"; 
     300            case BasicStroke.CAP_SQUARE: return "square"; 
     301            default: return null; 
     302        } 
    283303    } 
    284304} 
  • trunk/src/org/openstreetmap/josm/gui/mappaint/LineTextElemStyle.java

    r4006 r4281  
    2525 
    2626        TextElement text = TextElement.create(c, PaintColors.TEXT.get(), false); 
     27        if (text == null) 
     28            return null; 
    2729        return new LineTextElemStyle(c, text); 
    2830    } 
  • trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java

    r4191 r4281  
    122122 
    123123        LabelCompositionStrategy strategy = buildLabelCompositionStrategy(c, defaultAnnotate); 
     124        if (strategy == null) return null; 
    124125        Font font = ElemStyle.getFont(c); 
    125126 
Note: See TracChangeset for help on using the changeset viewer.