fix: isTouching was broked

This commit is contained in:
cha0s 2019-03-23 22:36:24 -05:00
parent 8418665892
commit 49b36dabe6

View File

@ -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]) {