use w and h for radii in ellipse intersects
This commit is contained in:
parent
2eb53fb8a3
commit
e994825668
1 changed files with 2 additions and 2 deletions
|
@ -138,9 +138,9 @@ inline bool rect_intersects(const PtkRect r, const PtkPos p) {
|
|||
|
||||
inline bool ellipse_intersects(const PtkEllipse e, const PtkPos p) {
|
||||
const float x = p.x - e.center.x;
|
||||
const float rx = e.radii.x;
|
||||
const float rx = e.radii.w;
|
||||
const float y = p.y - e.center.y;
|
||||
const float ry = e.radii.y;
|
||||
const float ry = e.radii.h;
|
||||
return ((x * x) / (rx * rx)) + ((y * y) / (ry * ry)) <= 1.0f;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue