- Timestamp:
- 2021-10-13T15:26:32+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r18211 r18275 61 61 private final Map<MapCSSRule, MapCSSTagCheckerAndRule> ruleToCheckMap = new HashMap<>(); 62 62 private static final Map<IPrimitive, Area> mpAreaCache = new HashMap<>(); 63 private static final Set<IPrimitive> toMatchForSurrounding = new HashSet<>(); 63 64 static final boolean ALL_TESTS = true; 64 65 static final boolean ONLY_SELECTED_TESTS = false; … … 161 162 } 162 163 163 Environment env = new Environment(p, new MultiCascade(), Environment.DEFAULT_LAYER, null);164 final Environment env = new Environment(p, new MultiCascade(), Environment.DEFAULT_LAYER, null); 164 165 env.mpAreaCache = mpAreaCache; 166 env.toMatchForSurrounding = toMatchForSurrounding; 165 167 166 168 Iterator<MapCSSRule> candidates = indexData.getRuleCandidates(p); … … 220 222 final Environment env = new Environment(p, new MultiCascade(), Environment.DEFAULT_LAYER, null); 221 223 env.mpAreaCache = mpAreaCache; 224 env.toMatchForSurrounding = toMatchForSurrounding; 222 225 for (Set<MapCSSTagCheckerRule> schecks : checksCol) { 223 226 for (MapCSSTagCheckerRule check : schecks) { … … 369 372 mpAreaCache.clear(); 370 373 ruleToCheckMap.clear(); 374 toMatchForSurrounding.clear(); 371 375 super.endTest(); 372 376 } … … 388 392 389 393 mpAreaCache.clear(); 394 toMatchForSurrounding.clear(); 390 395 391 396 Set<OsmPrimitive> surrounding = new HashSet<>(); … … 468 473 } 469 474 475 toMatchForSurrounding.clear(); 476 toMatchForSurrounding.addAll(tested); 470 477 for (OsmPrimitive p : surrounding) { 471 478 if (tested.contains(p)) -
trunk/src/org/openstreetmap/josm/gui/mappaint/Environment.java
r17744 r18275 87 87 */ 88 88 public Map<IPrimitive, Area> mpAreaCache; 89 90 /** 91 * Can be null, may contain primitives when surrounding objects of the primitives are tested 92 */ 93 public Set<IPrimitive> toMatchForSurrounding; 89 94 90 95 /** … … 141 146 this.crossingWaysMap = other.crossingWaysMap; 142 147 this.mpAreaCache = other.mpAreaCache; 148 this.toMatchForSurrounding = other.toMatchForSurrounding; 143 149 } 144 150 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r18208 r18275 378 378 toIgnore = null; 379 379 } 380 380 boolean filterWithTested = e.toMatchForSurrounding != null && !e.toMatchForSurrounding.isEmpty(); 381 381 for (IPrimitive p : primitives) { 382 if (filterWithTested && !e.toMatchForSurrounding.contains(p)) 383 continue; 382 384 if (isPrimitiveUsable(p) && Objects.equals(layer, OsmUtils.getLayer(p)) 383 385 && left.matches(new Environment(p).withParent(e.osm)) && isArea(p)
Note:
See TracChangeset
for help on using the changeset viewer.