-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
BorderRect
maintenance
#16727
BorderRect
maintenance
#16727
Conversation
* Renamed `square` to `all`. * Renamed `rectangle` to `axes`. * Renamed `value` to `extent`. * Updated the doc comments.
#[derive(Default, Copy, Clone, PartialEq, Debug, Reflect)] | ||
pub struct BorderRect { | ||
/// Pixel padding to the left |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, this was the only hint in docs in anything related to texture slicing about the values being in pixels. So it would be great to get that information back somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I'll add something to the TextureSlicer
docs I think. BorderRect
is used in different coordinate spaces so it doesn't make sense to refer to pixels here.
I like these changes, but seconding the request not to lose the information about pixels :) |
CI failure seems real and related: I think there's a conditional compilation issue here. |
I think it's just new stuff from #16693 that needs to be updated. |
Objective
The doc comments and function namings for
BorderRect
feel imprecise to me. Particularly thesquare
function which is used to define a uniformBorderRect
with equal widths on each edge. But this is potentially confusing since this "square" border could be around an oblong shape.Using "padding" to refer to the border extents seems undesirable too since "padding" is typically used to refer to the area between border and content, not the border itself.
Solution
square
toall
(this matches the name of the similar method onUiRect
).rectangle
toaxes
(this matches the name of the similar method onUiRect
).Migration Guide
The
square
andrectangle
functions belonging toBorderRect
have been renamed toall
andaxes
.