We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd19af9 commit 64c8f8aCopy full SHA for 64c8f8a
library/vecmath/vec2d/library/lenny/lib/rect.rb
@@ -11,8 +11,8 @@ def centroid
11
end
12
13
def contains?(vec)
14
- xminmax = [vec1.x, vec2.x]
15
- yminmax = [vec1.y, vec2.y]
+ xminmax = [vec1.x, vec2.x].minmax
+ yminmax = [vec1.y, vec2.y].minmax
16
return false if vec.x < xminmax[0]
17
return false if vec.x > xminmax[1]
18
return false if vec.y < yminmax[0]
0 commit comments