Skip to content
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

Problematic naming of Box2.Contains(Box2 other). Fixes Issue #1330. #1331

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danielscherzer
Copy link

@danielscherzer danielscherzer commented Sep 29, 2021

Purpose of this PR

Fixing the issue #1330 by changing Box2.Contains(Box2 other) to implement a "to have within" or "superset" operation in the mathematical sense. The current code

public bool Contains(Box2 other)
{
    return _max.X >= other._min.X && _min.X <= other._max.X &&
    _max.Y >= other._min.Y && _min.Y <= other._max.Y;
}

tests for overlap/intersection, so I will move it to a new Box2.Overlaps(Box2 other) method.

  • This affects the Math part of OpenTK

Testing status

  • I will change the current tests regarding Box2.Contains(Box2 other) to test the new Box2.Overlaps(Box2 other) and include new unit test for the new Box2.Contains(Box2 other) code.

@NogginBops
Copy link
Member

How does this PR change with the changes merged in #1037 ?

@danielscherzer
Copy link
Author

#1037 changes different parts of the Box code then my PR. So you could merge with #1037 and afterwards I could reapply my changes.

@NogginBops
Copy link
Member

Is this still a draft?

@danielscherzer danielscherzer marked this pull request as ready for review November 29, 2021 13:23
@danielscherzer
Copy link
Author

sorry! forgot to click read for review!

@NogginBops NogginBops added this to the 4.7.0 milestone Feb 3, 2022
@NogginBops NogginBops changed the title [WIP] Problematic naming of Box2.Contains(Box2 other). Fixes Issue #1330. Problematic naming of Box2.Contains(Box2 other). Fixes Issue #1330. Feb 3, 2022
@NogginBops
Copy link
Member

I'm going to retarget this PR to OpenTK 5 as we are moving all Box changes to that version.
You don't have to do anything with this PR, I can fix the retargeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants