Skip to content

Commit

Permalink
fixed contains bug
Browse files Browse the repository at this point in the history
  • Loading branch information
obviousjim committed Aug 5, 2012
1 parent bbf538b commit b465d57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ofRange.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/*
* ofRange_<T>.h
* SFEditor
*
* Created by Jim on 1/15/11.
* Created by James George on 1/15/11.
* Templated by Christopher Baker on 6/27/12
*
*/
Expand Down Expand Up @@ -60,9 +58,11 @@ class ofRange_ {
}

bool intersects(const ofRange_<T>& rg){
return contains(rg.min) || contains(rg.max);
bool intersects = this->contains(rg) || (min >= rg.min && max < rg.max) || contains(rg.min) || contains(rg.max);
return intersects;
}

//this is broken
ofRange_<T> getClamped(const ofRange_<T>& rg){
return contains(rg.min) || contains(rg.max);
}
Expand Down

0 comments on commit b465d57

Please sign in to comment.