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

Concerns around impl From<((f64, f64), (f64, f64))> for Rect #29

Closed
cmyr opened this issue Jun 21, 2019 · 3 comments · Fixed by #30
Closed

Concerns around impl From<((f64, f64), (f64, f64))> for Rect #29

cmyr opened this issue Jun 21, 2019 · 3 comments · Fixed by #30

Comments

@cmyr
Copy link
Member

cmyr commented Jun 21, 2019

This is currently implemented, and I think that it is likely to be misused.

A rect can be constructed from a pair of points or from a point and a size. There is no way to know from this implementation which behaviour to expect.

I think it would be reasonable to have a conversion between Rect and (f64, f64, f64, f64), cooresponding to (minx, miny, maxx, maxy), but I think ((f64, f64), (f64, f64)), if implemented, should default to (origin, size), but the fact that there's any room for confusion makes me feel that it should be removed.

@raphlinus
Copy link
Contributor

Totally fine with me to remove this.

@cmyr
Copy link
Member Author

cmyr commented Jun 21, 2019

unfortunately it's a breaking change..

@raphlinus
Copy link
Contributor

raphlinus commented Jun 21, 2019

Move fast and break things, that's my current motto. Although we can think of a few things to batch up here, possibly another shot at #4 if that breaks anything.

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 a pull request may close this issue.

2 participants