summaryrefslogtreecommitdiff
path: root/vec2.js
diff options
context:
space:
mode:
Diffstat (limited to 'vec2.js')
-rw-r--r--vec2.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/vec2.js b/vec2.js
index 8bc8410..973613f 100644
--- a/vec2.js
+++ b/vec2.js
@@ -43,7 +43,7 @@ vec2.prototype.contains = function(n){
}
// assumes (vec2)v falls to the right of (vec2)this
vec2.prototype.intersects = function(v){
- return (this.b > v.a) || (v.b > this.a)
+ return (this.b > v.a && this.b < v.b) || (v.b > this.a && v.b < this.b)
}
vec2.prototype.union = function(v){
if (this.intersects(v)) {