Ignore:
Timestamp:
2017-10-11T20:42:06+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #14132 - MapCSS crossing operator must check layer attribute first

File:
1 edited

Legend:

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

    r12809 r12986  
    88import java.util.List;
    99import java.util.NoSuchElementException;
     10import java.util.Objects;
    1011import java.util.Set;
    1112import java.util.function.IntFunction;
     
    1617import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1718import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     19import org.openstreetmap.josm.data.osm.OsmUtils;
    1820import org.openstreetmap.josm.data.osm.Relation;
    1921import org.openstreetmap.josm.data.osm.RelationMember;
     
    258260
    259261        private final class CrossingFinder extends AbstractFinder {
     262
     263            private final String layer;
     264
    260265            private CrossingFinder(Environment e) {
    261266                super(e);
    262267                CheckParameterUtil.ensureThat(e.osm instanceof Way, "Only ways are supported");
     268                layer = OsmUtils.getLayer(e.osm);
    263269            }
    264270
    265271            @Override
    266272            public void visit(Way w) {
    267                 if (e.child == null && left.matches(new Environment(w).withParent(e.osm))
     273                if (e.child == null && Objects.equals(layer, OsmUtils.getLayer(w))
     274                    && left.matches(new Environment(w).withParent(e.osm))
    268275                    && e.osm instanceof Way && Geometry.PolygonIntersection.CROSSING.equals(
    269276                            Geometry.polygonIntersection(w.getNodes(), ((Way) e.osm).getNodes()))) {
Note: See TracChangeset for help on using the changeset viewer.