-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Fix AABB.encloses
failing on shared upper bound
#87118
Conversation
This differs from `Rect2(i)` and was fixed for those classes in the past
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, this is good for consistency and I'd say matches user expectations. Approved.
Would like @lawnjelly's opinion on this, I remember a lot of bikeshedding last time we attempted changing such conventions. |
The bikeshedding in #57469 was mostly about |
Yes this is fine imo. The difficult version is the integer bound where you can have exclusive or inclusive definition at upper border. 👍 |
Will add some extra checks like these to the And I'll open a stripped down 3.x one without the tests |
Thanks! |
Thank you! |
Cherry-picked for 4.2.2. |
This differs from
Rect2(i)
and was fixed for those classes in the pastSee:
Which fixed this for those types, makes sense to me to have parity between the two, and it doesn't make sense to only allow it on one side, or fail to enclose yourself. I'd also say that the following should be equivalent:
a.encloses(b)
anda.intersection(b) == b
Essentially: Either it should be true only when no sides touch, or it should allow any side to touch, an alternative would be to add an
encloses_inclusive
or some other wording that does what this does, and change all the checks for theencloses
to be strict(Will open a godot-cpp equivalent if this gets approved)