-
Notifications
You must be signed in to change notification settings - Fork 627
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
Renamed Inflate to Union and added new Inflated implementation #1455
Conversation
Thanks for the PR! This is a breaking change that is quite bad for users of the math types. It will not give any indication of changes but it will cause a breakage in functionality. I can agree that it would make sense to match the There have been previous work on making the box math types better, see: #1341 #1037 (moved with #1378) #1331 |
I absolutely understand. One of the possible ways to merge this would be in 2 steps.
This would give time to people that follow the releases but not to those who update from prior version. This also depends on when the release of 5.0 occurs. |
Sorry for late reply. I'm thinking we are going to have to make a migration guide for OpenTK 5, so maybe having a function with the same name but different behavior might be fine. Our unofficial official motto for release dates is "this decade" so OpenTK 5 might come soon, but it might also take a bit. Are you more interested in getting a function for doing what |
For naming, it's really confusing to have |
The migration guide would be for OpenTK 5, which means that we don't want to do this breaking change in OpenTK 4. We can definitely have the "correct" naming in OpenTK 5, but changing the behavior of this function without anyone being able to tell is not something we are doing to do. Basically my main problem is that someone who has code using the current behavior of So I think that just deprecating |
@Phyyl I'm guessing you're no longer going to pursue this change/PR? |
I'm extremely busy these days and I can't contribute much right now. If there's a more specific task to be done I'd be happy to make room in my schedule but for now I'm using my own types. |
That's ok, hope you will get time to contribute in the future 🙂 |
Great thanks! |
Purpose of this PR
Testing status
Comments
Terminology between Box structs and System.Drawing.Rectangle structs are divergent.
Box.Inflate
currently enlarges a rectangle to include a point. However, Rectangle.Inflate actually extends the size of the rectangle uniformly in all directions. I believe this is a lot more consistent with the termInflate
.In this PR, the old
Inflate
behavior was moved toUnion
andInflate
now has the same behavior asRectangle
.I know this was discussed in #1037 but I truely believe we should keep it in line with System.Drawing. Union makes more sense when you think of two boxes, why not also for a box and a point? Adding to that, What would you call inflating a box otherwise?
The only thing that bothers me is the change in API and the breaking change that this brings. That said, I still went ahead and made the change because I consider it
[...] correcting the behaviour to an expected result.