Ticket #13251: improve_polygon_intersection_test.patch

File improve_polygon_intersection_test.patch, 870 bytes (added by GerdP, 5 years ago)
  • core/src/org/openstreetmap/josm/tools/Geometry.java

     
    563563
    564564        if (inter.isEmpty() || bounds.getHeight()*bounds.getWidth() <= eps) {
    565565            return PolygonIntersection.OUTSIDE;
    566         } else if (inter.equals(a1)) {
     566        } else if (a2.getBounds2D().contains(a1.getBounds2D()) && inter.equals(a1)) {
    567567            return PolygonIntersection.FIRST_INSIDE_SECOND;
    568         } else if (inter.equals(a2)) {
     568        } else if (a1.getBounds2D().contains(a2.getBounds2D()) && inter.equals(a2)) {
    569569            return PolygonIntersection.SECOND_INSIDE_FIRST;
    570570        } else {
    571571            return PolygonIntersection.CROSSING;