BorderRect maintenance#16727
Merged
alice-i-cecile merged 6 commits intobevyengine:mainfrom Dec 12, 2024
Merged
Conversation
* Renamed `square` to `all`. * Renamed `rectangle` to `axes`. * Renamed `value` to `extent`. * Updated the doc comments.
rparrett
reviewed
Dec 9, 2024
| /// of a rectangle (left, right, top, and bottom), with values increasing inwards. | ||
| #[derive(Default, Copy, Clone, PartialEq, Debug, Reflect)] | ||
| pub struct BorderRect { | ||
| /// Pixel padding to the left |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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.
Member
|
I like these changes, but seconding the request not to lose the information about pixels :) |
alice-i-cecile
approved these changes
Dec 11, 2024
BenjaminBrienen
approved these changes
Dec 11, 2024
Member
|
CI failure seems real and related: I think there's a conditional compilation issue here. |
Contributor
|
I think it's just new stuff from #16693 that needs to be updated. |
BenjaminBrienen
approved these changes
Dec 11, 2024
Trashtalk217
pushed a commit
to Trashtalk217/bevy
that referenced
this pull request
Dec 21, 2024
# Objective The doc comments and function namings for `BorderRect` feel imprecise to me. Particularly the `square` function which is used to define a uniform `BorderRect` 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 * Rename `square` to `all` (this matches the name of the similar method on `UiRect`). * Rename `rectangle` to `axes` (this matches the name of the similar method on `UiRect`). * Update doc comments. ## Migration Guide The `square` and `rectangle` functions belonging to `BorderRect` have been renamed to `all` and `axes`. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
ecoskey
pushed a commit
to ecoskey/bevy
that referenced
this pull request
Jan 6, 2025
# Objective The doc comments and function namings for `BorderRect` feel imprecise to me. Particularly the `square` function which is used to define a uniform `BorderRect` 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 * Rename `square` to `all` (this matches the name of the similar method on `UiRect`). * Rename `rectangle` to `axes` (this matches the name of the similar method on `UiRect`). * Update doc comments. ## Migration Guide The `square` and `rectangle` functions belonging to `BorderRect` have been renamed to `all` and `axes`. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
The doc comments and function namings for
BorderRectfeel imprecise to me. Particularly thesquarefunction which is used to define a uniformBorderRectwith 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
squaretoall(this matches the name of the similar method onUiRect).rectangletoaxes(this matches the name of the similar method onUiRect).Migration Guide
The
squareandrectanglefunctions belonging toBorderRecthave been renamed toallandaxes.