Commits

jorgenpt committed 262b572

Fix Circle#contains(x,y).

Previous implementation used top left corner as center of circle for contains().

Comments (0)

Files changed (1)

trunk/Slick/src/org/newdawn/slick/geom/Circle.java

 	 */
     public boolean contains(float x, float y) 
     { 
-        return (x - getX()) * (x - getX()) + (y - getY()) * (y - getY()) < getRadius() * getRadius(); 
+        float xDelta = x - getCenterX(), yDelta = y - getCenterY();
+        return xDelta * xDelta + yDelta * yDelta < getRadius() * getRadius();
     }
     
     /**