Fixed Ellipse contains function

This commit is contained in:
Mat Groves 2014-02-09 16:34:34 +00:00
parent 4c911dcdd9
commit 09d1354b32
5 changed files with 14328 additions and 9 deletions

View file

@ -423,14 +423,13 @@ PIXI.Ellipse.prototype.contains = function(x, y)
return false;
//normalize the coords to an ellipse with center 0,0
//and a radius of 0.5
var normx = ((x - this.x) / this.width) - 0.5,
normy = ((y - this.y) / this.height) - 0.5;
var normx = ((x - this.x) / this.width),
normy = ((y - this.y) / this.height);
normx *= normx;
normy *= normy;
return (normx + normy < 0.25);
return (normx + normy <= 1);
};
/**