You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the former is more convenient, because having 2 rectangles with a perfectly aligned edge is has 0 intersection area. I think I would argue that if the area of intersection is 0, intersects should return false.
We can see with a simple example, this behaviour is a bit inconsistent. There are no tests for either right now.
I learned this making a small game with my son, and the overhead of changing and adding tests and creating a PR felt a bit high. But, can do if you need.
Rect.Intersect specifically calculates the ZR intersection using inclusive operators:
Rect.Intersects uses exclusive operators:
I think the former is more convenient, because having 2 rectangles with a perfectly aligned edge is has 0 intersection area. I think I would argue that if the area of intersection is 0, intersects should return false.
We can see with a simple example, this behaviour is a bit inconsistent. There are no tests for either right now.
I learned this making a small game with my son, and the overhead of changing and adding tests and creating a PR felt a bit high. But, can do if you need.
Program to repro:
The text was updated successfully, but these errors were encountered: