Ignore:
Timestamp:
2015-02-20T12:34:09+01:00 (10 years ago)
Author:
malcolmh
Message:

cope with missing nodes

Location:
applications/editors/josm/plugins/seachart/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/src/render/Renderer.java

    r31028 r31031  
    195195                                        git.nextEdge();
    196196                                        while (git.hasNode()) {
     197                                                Snode node = git.next();
     198                                                if (node == null) continue;
    197199                                                prev = next;
    198                                                 next = context.getPoint(git.next());
     200                                                next = context.getPoint(node);
    199201                                                angle = Math.atan2(next.getY() - prev.getY(), next.getX() - prev.getX());
    200202                                                piv = true;
     
    265267                                }
    266268                                while (git.hasNode()) {
    267                                         point = context.getPoint(git.next());
     269                                        Snode node = git.next();
     270                                        if (node == null) continue;
     271                                        point = context.getPoint(node);
    268272                                        p.lineTo(point.getX(), point.getY());
    269273                                }
     
    343347                                        p.moveTo(point.getX(), point.getY());
    344348                                        while (git.hasNode()) {
    345                                                 point = context.getPoint(git.next());
     349                                                Snode node = git.next();
     350                                                if (node == null) continue;
     351                                                point = context.getPoint(node);
    346352                                                p.lineTo(point.getX(), point.getY());
    347353                                        }
     
    492498                                        git.nextEdge();
    493499                                        while (git.hasNode()) {
     500                                                Snode node = git.next();
     501                                                if (node == null) continue;
    494502                                                prev = next;
    495                                                 next = context.getPoint(git.next());
     503                                                next = context.getPoint(node);
    496504                                                angle = Math.atan2(next.getY() - prev.getY(), next.getX() - prev.getX());
    497505                                                piv = true;
  • applications/editors/josm/plugins/seachart/src/s57/S57map.java

    r31028 r31031  
    942942                                while (git.hasNode()) {
    943943                                        node = git.next();
    944                                         if (node != null) {
    945                                                 llon = lon;
    946                                                 llat = lat;
    947                                                 lat = node.lat;
    948                                                 lon = node.lon;
    949                                                 sigma += (lon * Math.sin(llat)) - (llon * Math.sin(lat));
    950                                         }
     944                                        if (node == null) continue;
     945                                        llon = lon;
     946                                        llat = lat;
     947                                        lat = node.lat;
     948                                        lon = node.lon;
     949                                        sigma += (lon * Math.sin(llat)) - (llon * Math.sin(lat));
    951950                                }
    952951                        }
     
    10091008                                        while (git.hasNode()) {
    10101009                                                Snode node = git.next();
     1010                                                if (node == null) continue;
    10111011                                                lat = node.lat;
    10121012                                                lon = node.lon;
     
    10311031                                        while (git.hasNode()) {
    10321032                                                Snode node = git.next();
     1033                                                if (node == null) continue;
    10331034                                                lat = node.lat;
    10341035                                                lon = node.lon;
Note: See TracChangeset for help on using the changeset viewer.