Skip to content

Commit 8903a07

Browse files
committed
swap to less
1 parent f92b6fb commit 8903a07

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/base/geom/rect.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,17 @@ bool Rect::intersects(const Rect &r) const
9595
{
9696
using Math::Floating::is_zero;
9797
using std::strong_order;
98-
auto first = strong_order(r.left(), right());
99-
auto second = strong_order(left(), r.right());
100-
auto third = strong_order(r.bottom(), top());
101-
auto fourth = strong_order(bottom(), r.top());
98+
auto first = strong_order(right(), r.left());
99+
auto second = strong_order(r.right(), left());
100+
auto third = strong_order(top(), r.bottom());
101+
auto fourth = strong_order(r.top(), bottom());
102102

103103
auto isOutside =
104-
is_gt(first)
104+
is_lt(first) || is_lt(second) || is_lt(third) || is_lt(fourth)
105105
|| (is_eq(first) && !is_zero(width()) && !is_zero(r.width()))
106-
|| is_gt(second)
107106
|| (is_eq(second) && !is_zero(width()) && !is_zero(r.width()))
108-
|| is_gt(third)
109107
|| (is_eq(third) && !is_zero(height())
110108
&& !is_zero(r.height()))
111-
|| is_gt(fourth)
112109
|| (is_eq(fourth) && !is_zero(height())
113110
&& !is_zero(r.height()));
114111
return !isOutside;

0 commit comments

Comments
 (0)