Index: core/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- core/src/org/openstreetmap/josm/tools/Geometry.java	(revision 10681)
+++ core/src/org/openstreetmap/josm/tools/Geometry.java	(working copy)
@@ -563,9 +563,9 @@
 
         if (inter.isEmpty() || bounds.getHeight()*bounds.getWidth() <= eps) {
             return PolygonIntersection.OUTSIDE;
-        } else if (inter.equals(a1)) {
+        } else if (a2.getBounds2D().contains(a1.getBounds2D()) && inter.equals(a1)) {
             return PolygonIntersection.FIRST_INSIDE_SECOND;
-        } else if (inter.equals(a2)) {
+        } else if (a1.getBounds2D().contains(a2.getBounds2D()) && inter.equals(a2)) {
             return PolygonIntersection.SECOND_INSIDE_FIRST;
         } else {
             return PolygonIntersection.CROSSING;
