OSDN Git Service

rectangle.overlap() and Intersector.overlapRectangles() behaves the same now.
authorStefan Bachmann <st.lebach@gmail.com>
Thu, 31 Jan 2013 19:59:33 +0000 (11:59 -0800)
committerStefan Bachmann <st.lebach@gmail.com>
Thu, 31 Jan 2013 19:59:33 +0000 (11:59 -0800)
gdx/src/com/badlogic/gdx/math/Intersector.java

index 7560140..47b3fe2 100644 (file)
@@ -717,10 +717,7 @@ public final class Intersector {
        }
 
        public static boolean overlapRectangles (Rectangle r1, Rectangle r2) {
-               if (r1.x < r2.x + r2.width && r1.x + r1.width > r2.x && r1.y < r2.y + r2.height && r1.y + r1.height > r2.y)
-                       return true;
-               else
-                       return false;
+               return r1.overlaps(r2);
        }
 
        public static boolean overlapCircleRectangle (Circle c, Rectangle r) {