fix: isTouching was broked
This commit is contained in:
parent
8418665892
commit
49b36dabe6
|
@ -37,10 +37,10 @@ export function intersects (l, r) {
|
|||
// avocado> Rectangle.intersects [0, 0, 16, 16], [16, 16]
|
||||
// false
|
||||
export function isTouching (r, v) {
|
||||
if (v[0] < r[0]) {
|
||||
if (v[0] + v[2] < r[0]) {
|
||||
return false;
|
||||
}
|
||||
if (v[1] < r[1]) {
|
||||
if (v[1] + v[3] < r[1]) {
|
||||
return false;
|
||||
}
|
||||
if (v[0] >= r[0] + r[2]) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user