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

TypedRect::from_points soundness #211

Closed
kvark opened this issue Jun 9, 2017 · 2 comments
Closed

TypedRect::from_points soundness #211

kvark opened this issue Jun 9, 2017 · 2 comments

Comments

@kvark
Copy link
Member

kvark commented Jun 9, 2017

It actually produces the bounding rectangle of points, yet the name does not imply that.
I suggest having separate methods for the inner/outer rectangle produced, and deprecate the original from_points.
cc @nical

@nical
Copy link
Contributor

nical commented Jun 10, 2017

I don't see any other useful way to build a rectangle from a set of points, so I don't think that there is any ambiguity or soundness issue to worry about. But I don't understand what you meant by inner and outer rectangles in this context so I may be missing something.

If you want to rename this into something more specific that's fine by me (I just don't want to do another major euclid bump in all of the servo crates, so deprecating this one first sounds good).

@kvark
Copy link
Member Author

kvark commented Jun 12, 2017

I don't see any other useful way to build a rectangle from a set of points,

What I had in mind is an "inner" rectangle. I.e. when you transform an aligned rectangle, getting 4 points, and would like to find a largest rectangle contained within the transformed region.

Come to think of it now, this implies that the points describe a convex shape, which is a different semantics (more specific one) than the current from_points, so I think leaving the current logic in place is reasonable.

@kvark kvark closed this as completed Jun 12, 2017
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

No branches or pull requests

2 participants