File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments