Index: /trunk/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 10683)
+++ /trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 10684)
@@ -564,7 +564,7 @@
         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 {
