From b9653e6f55a96f3769a980b2569fc9fabad9f374 Mon Sep 17 00:00:00 2001
From: Harvey Harrison <harvey.harrison@gmail.com>
Date: Mon, 15 Oct 2012 20:24:17 -0700
Subject: jogl: remove infinite loop in Path2D.contains(AABBox)

It is impossible to use this method as it will get into an infinite loop as it
just calls itself.  Base the implementation on the contains method shortly before
this method.  As this method is impossible to actually use, it could also just
be removed.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 src/jogl/classes/jogamp/graph/geom/plane/Path2D.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'src/jogl/classes/jogamp')

diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
index 8082fe4e1..bf5f5e9b6 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
@@ -397,7 +397,12 @@ public final class Path2D implements Cloneable {
     }
 
     public boolean contains(AABBox r) {
-        return contains(r);
+        float lx = r.getMinX();
+        float ly = r.getMinY();
+        float w = r.getWidth();
+        float h = r.getHeight();
+        int cross = Crossing.intersectShape(this, lx, ly, w, h);
+        return cross != Crossing.CROSSING && isInside(cross);
     }
 
     public boolean intersects(AABBox r) {
-- 
cgit v1.2.3