Slick Forums

Discuss the Slick 2D Library
It is currently Sun Dec 09, 2018 11:24 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Dec 05, 2012 5:35 pm 
Offline

Joined: Fri Oct 07, 2011 9:08 pm
Posts: 3
Both of these give wrong results...

System.out.println(new Circle(10, 10, 2).contains(8, 8)); // True
System.out.println(new Circle(10, 10, 2).contains(10, 10)); // False

The code looks like this:

Code:
        return (x - getX()) * (x - getX()) + (y - getY()) * (y - getY()) < getRadius() * getRadius();


I think it should be

Code:
        return (x - getCenterX()) * (x - getCenterX()) + (y - getCenterY()) * (y - getCenterY()) < getRadius() * getRadius();


Top
 Profile  
 
PostPosted: Mon Jan 21, 2013 6:47 pm 
Offline

Joined: Mon Jan 21, 2013 6:46 pm
Posts: 1
I found this too - I've submitted a pull request that fixes this bug.

https://bitbucket.org/kevglass/slick/pu ... shape/diff


Top
 Profile  
 
PostPosted: Fri Jan 25, 2013 4:45 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
Please send pull requests for development branch, not default branch. Thanks. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group