Ignore:
Timestamp:
2009-02-18T23:31:32+01:00 (16 years ago)
Author:
pieren
Message:

Fix minor bugs, add the fixed size grab scale configurable, fix pbls in transparency.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SVGParser.java

    r13545 r13784  
    1414    private String cViewBoxEnd = "\"";
    1515    private String cPathStart = "<path d=\"";
    16     private String cPathEnd = "\"/>";
     16    private String cClosedPathEnd = "\"/>";
    1717
    1818    /**
     
    4040    }
    4141   
    42     public String [] getPaths(String svg) {
     42    /**
     43     * Closed SVG paths are finishing with a "Z" at the end of the moves list.
     44     * @param svg
     45     * @return
     46     */
     47    public String [] getClosedPaths(String svg) {
    4348        ArrayList<String> path = new ArrayList<String>();
    4449        int i = 0;
    4550        while (svg.indexOf(cPathStart, i) != -1) {
    4651            int s = svg.indexOf(cPathStart, i) + cViewBoxStart.length();
    47             int e = svg.indexOf(cPathEnd, s);
     52            int e = svg.indexOf(cClosedPathEnd, s);
    4853            if (s != -1 && e != -1) {
    49                 path.add(svg.substring(s, e));
     54                String onePath = svg.substring(s, e);
     55                if (onePath.indexOf("Z") != -1) // only closed SVG path
     56                    path.add(onePath);
    5057            } else
    5158                break;
Note: See TracChangeset for help on using the changeset viewer.