Changeset 15938 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
- Timestamp:
- 2020-02-26T17:16:35+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r15925 r15938 4 4 import static org.openstreetmap.josm.data.projection.Ellipsoid.WGS84; 5 5 6 import java.awt.geom.Area; 6 7 import java.text.MessageFormat; 7 8 import java.util.ArrayList; 8 9 import java.util.Collection; 9 10 import java.util.Collections; 11 import java.util.HashMap; 10 12 import java.util.LinkedHashSet; 11 13 import java.util.List; … … 31 33 import org.openstreetmap.josm.tools.CheckParameterUtil; 32 34 import org.openstreetmap.josm.tools.Geometry; 35 import org.openstreetmap.josm.tools.Geometry.PolygonIntersection; 33 36 import org.openstreetmap.josm.tools.Logging; 37 import org.openstreetmap.josm.tools.Pair; 34 38 import org.openstreetmap.josm.tools.Utils; 35 39 … … 298 302 299 303 private final String layer; 304 private Area area; 300 305 301 306 private CrossingFinder(Environment e) { … … 309 314 if (Objects.equals(layer, OsmUtils.getLayer(w)) 310 315 && left.matches(new Environment(w).withParent(e.osm)) 311 && e.osm instanceof IWay && Geometry.PolygonIntersection.CROSSING.equals( 312 Geometry.polygonIntersection(w.getNodes(), ((IWay<?>) e.osm).getNodes()))) { 313 addToChildren(e, w); 316 && e.osm instanceof IWay) { 317 if (area == null) { 318 area = Geometry.getAreaEastNorth(e.osm); 319 } 320 Pair<PolygonIntersection, Area> is = Geometry.polygonIntersectionResult( 321 Geometry.getAreaEastNorth(w), area, Geometry.INTERSECTION_EPS_EAST_NORTH); 322 if (Geometry.PolygonIntersection.CROSSING == is.a) { 323 addToChildren(e, w); 324 // store intersection area to improve highlight and zoom to problem 325 if (e.intersections == null) { 326 e.intersections = new HashMap<>(); 327 } 328 e.intersections.put(w, is.b); 329 } 314 330 } 315 331 }
Note:
See TracChangeset
for help on using the changeset viewer.