...
This commit is contained in:
parent
5142127ae0
commit
4ac6a1bb70
1 changed files with 4 additions and 4 deletions
|
@ -127,11 +127,11 @@ inline bool triangle_intersects(const PtkTriangle t, const PtkPos p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool rect_intersects(const PtkRect r, const PtkPos p) {
|
inline bool rect_intersects(const PtkRect r, const PtkPos p) {
|
||||||
const bool intersects_x = r.top_left.x <= p.x
|
const bool intersects_x = p.x >= r.top_left.x &&
|
||||||
&& r.top_left.x + r.top_left.w >= p.x;
|
p.x <= r.top_left.x + r.size.w;
|
||||||
|
|
||||||
const bool intersects_y = r.top_left.y <= p.y
|
const bool intersects_y = p.y >= r.top_left.y &&
|
||||||
&& r.top_left.y + r.top_left.h >= p.y;
|
p.y <= r.top_left.y + r.size.h;
|
||||||
|
|
||||||
return intersects_x && intersects_y;
|
return intersects_x && intersects_y;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue