Changeset 11992 in josm


Ignore:
Timestamp:
2017-04-24T01:13:54+02:00 (2 years ago)
Author:
Don-vip
Message:

fix #13665 - handle deleted nodes in way rendering

Location:
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java

    r11357 r11992  
    223223    public void visitVirtual(Path2D path, Way w) {
    224224        Iterator<Node> it = w.getNodes().iterator();
    225         if (it.hasNext()) {
    226             MapViewPoint lastP = mapState.getPointFor(it.next());
    227             while (it.hasNext()) {
    228                 MapViewPoint p = mapState.getPointFor(it.next());
    229                 if (isSegmentVisible(lastP, p) && isLargeSegment(lastP, p, virtualNodeSpace)) {
     225        MapViewPoint lastP = null;
     226        while (it.hasNext()) {
     227            Node n = it.next();
     228            if (n.isLatLonKnown()) {
     229                MapViewPoint p = mapState.getPointFor(n);
     230                if (lastP != null && isSegmentVisible(lastP, p) && isLargeSegment(lastP, p, virtualNodeSpace)) {
    230231                    double x = (p.getInViewX()+lastP.getInViewX())/2;
    231232                    double y = (p.getInViewY()+lastP.getInViewY())/2;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/OffsetIterator.java

    r11696 r11992  
    55import java.util.List;
    66import java.util.NoSuchElementException;
     7import java.util.stream.Collectors;
    78
    89import org.openstreetmap.josm.data.osm.Node;
     
    4243    public OffsetIterator(MapViewState mapState, List<Node> nodes, double offset) {
    4344        this.mapState = mapState;
    44         this.nodes = nodes;
     45        this.nodes = nodes.stream().filter(Node::isLatLonKnown).collect(Collectors.toList());
    4546        this.offset = offset;
    4647        idx = 0;
Note: See TracChangeset for help on using the changeset viewer.