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

Implements #4360 #4460

Merged
merged 6 commits into from Dec 7, 2016
Merged

Implements #4360 #4460

merged 6 commits into from Dec 7, 2016

Conversation

kerberjg
Copy link
Contributor

@kerberjg kerberjg commented Dec 6, 2016

Makes BoundingBox compatible with 2D by performing a "greater or equal" comparison between min and max in BoundingBox#isValid().

Naturally, this would cause a BoundingBox with an area of 0 to be considered valid, so a && !dim.isZero() was added to the expression as well in order to prevent that.

EDIT: updated the dim size check

@Darkyenus
Copy link
Contributor

Am I missing something or would this mean that only zero-size bounding box is considered valid? Shouldn't it be !dim.isZero()?

@kerberjg
Copy link
Contributor Author

kerberjg commented Dec 6, 2016

@Darkyenus You're right, it was a typo. Just fixed it.

@xoppa
Copy link
Member

xoppa commented Dec 6, 2016

Why did you make an exception for at least one axis to be not zero? If a zero volume (3D) is valid and a zero area (2D) is a valid then I guess that a zero length (1D) should be valid as well.

@kerberjg
Copy link
Contributor Author

kerberjg commented Dec 7, 2016

@xoppa I actually had in mind that none of them are to be considered valid, but I guess that's a mistake. Upon further consideration it could be considered valid indeed.

@@ -210,7 +210,7 @@ public BoundingBox clr () {
/** Returns whether this bounding box is valid. This means that {@link #max} is greater than or equal to {@link #min}, with {@link #dim} greater than zero.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should update comment also.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done now

@xoppa xoppa merged commit ac0a527 into libgdx:master Dec 7, 2016
@xoppa
Copy link
Member

xoppa commented Dec 7, 2016

Thanks

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

Successfully merging this pull request may close these issues.

None yet

4 participants