Fixed Ellipse contains function
This commit is contained in:
parent
4c911dcdd9
commit
09d1354b32
5 changed files with 14328 additions and 9 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue