Skip to content

Commit 63f81ce

Browse files
committed
simplify
1 parent 8903a07 commit 63f81ce

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/base/geom/rect.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,12 @@ bool Rect::intersects(const Rect &r) const
100100
auto third = strong_order(top(), r.bottom());
101101
auto fourth = strong_order(r.top(), bottom());
102102

103-
auto isOutside =
104-
is_lt(first) || is_lt(second) || is_lt(third) || is_lt(fourth)
105-
|| (is_eq(first) && !is_zero(width()) && !is_zero(r.width()))
106-
|| (is_eq(second) && !is_zero(width()) && !is_zero(r.width()))
107-
|| (is_eq(third) && !is_zero(height())
108-
&& !is_zero(r.height()))
109-
|| (is_eq(fourth) && !is_zero(height())
110-
&& !is_zero(r.height()));
103+
auto isOutside = is_lt(first) || is_lt(second) || is_lt(third)
104+
|| is_lt(fourth)
105+
|| ((is_eq(first) || is_eq(second))
106+
&& !is_zero(width()) && !is_zero(r.width()))
107+
|| ((is_eq(third) || is_eq(fourth))
108+
&& !is_zero(height()) && !is_zero(r.height()));
111109
return !isOutside;
112110
}
113111

0 commit comments

Comments
 (0)