Container::rounded takes KeyOrValue<f64> instead of f64 #1054
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1052.
This is my first PR, and I'm not completely sure how things are done. However, the change is really small, so I don't think there's much that can go wrong.
I checked that all the tests pass, and I also tried this out in an unpublished application that I had lying around.
I think this change should be semver-safe, but I'm not sure. Some downstream crate's type inference might break, because the
rounded
function becomes more general. However, in the most common case you simply pass a float literal, and that case doesn't break. Still, I don't have any experience in Rust API design to completely rule out this problem.Performance is probably irrelevant. At the moment,
paint()
unconditionally loads the border radius, even if it doesn't need it. I could improve that with some way-too-clever caching code that would be annoying to write and, more importantly, horrible to read, so I decided not to do that.