Changeset 6611 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
- Timestamp:
- 2014-01-03T17:14:36+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r6609 r6611 160 160 @Override 161 161 public void visit(Node n) { 162 if (e. parent== null &&right.matches(e.withPrimitive(n))) {162 if (e.child == null && left.matches(e.withPrimitive(n))) { 163 163 if (e.osm instanceof Way && Geometry.nodeInsidePolygon(n, ((Way) e.osm).getNodes()) 164 164 || e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() && Geometry.isNodeInsideMultiPolygon(n, (Relation) e.osm, null)) { 165 e. parent= n;165 e.child = n; 166 166 } 167 167 } … … 170 170 @Override 171 171 public void visit(Way w) { 172 if (e. parent== null &&right.matches(e.withPrimitive(w))) {172 if (e.child == null && left.matches(e.withPrimitive(w))) { 173 173 if (e.osm instanceof Way && Geometry.PolygonIntersection.FIRST_INSIDE_SECOND.equals(Geometry.polygonIntersection(w.getNodes(), ((Way) e.osm).getNodes())) 174 174 || e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() && Geometry.isPolygonInsideMultiPolygon(w.getNodes(), (Relation) e.osm, null)) { 175 e. parent= w;175 e.child = w; 176 176 } 177 177 } … … 184 184 public void visit(Collection<? extends OsmPrimitive> primitives) { 185 185 for (OsmPrimitive p : primitives) { 186 if (e. parent!= null) {186 if (e.child != null) { 187 187 // abort if first match has been found 188 188 break; … … 206 206 return false; 207 207 } 208 e. child= e.osm;208 e.parent = e.osm; 209 209 210 210 final ContainsFinder containsFinder = new ContainsFinder(e); … … 221 221 } 222 222 223 return e. parent!= null;223 return e.child != null; 224 224 225 225 } else if (ChildOrParentSelectorType.CHILD.equals(type)) { … … 374 374 375 375 public boolean matchesBase(OsmPrimitiveType type) { 376 if (OsmPrimitiveType.NODE.equals(type)) { 377 return base.equals("node") || base.equals("*"); 376 if (base.equals("*")) { 377 return true; 378 } else if (OsmPrimitiveType.NODE.equals(type)) { 379 return base.equals("node"); 378 380 } else if (OsmPrimitiveType.WAY.equals(type)) { 379 return base.equals("way") || base.equals("area") || base.equals("*");381 return base.equals("way") || base.equals("area"); 380 382 } else if (OsmPrimitiveType.RELATION.equals(type)) { 381 383 return base.equals("area") || base.equals("relation") || base.equals("canvas");
Note:
See TracChangeset
for help on using the changeset viewer.
