-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
ImageNode should allow drawing over padding #24150
Copy link
Copy link
Closed
Labels
A-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-ReviewNeeds reviewer attention (from anyone!) to move forwardNeeds reviewer attention (from anyone!) to move forwardX-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through
Metadata
Metadata
Assignees
Labels
A-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-ReviewNeeds reviewer attention (from anyone!) to move forwardNeeds reviewer attention (from anyone!) to move forwardX-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through
Type
Projects
Status
Done
Bevy version and features
0.19-dev
What you did
I created an entity with a
NodeandImageNodecomponents. TheNodehas a padding of 12 pixels.What went wrong
I expected the image to draw over the padding area, not to be confined within the padding area. That is, I expected the image to extend all the way from the left border to the right border, and the top border to the bottom border.
Generally when you assign an image to a node, you do so because you want the image to serve as a background. The padding should affect the layout of children, but the
ImageNodeis not a child.Additional information
I recognize that this may have backwards compatibility concerns. However, I think that being able to use the image node as a background is a much more useful choice.
For example, if I want to display a nine-sliced button with a text caption, I want to be able to use padding to create some space around the caption. With things as they currently are, I have to instead create an additional wrapper entity around the caption text, so that the wrapper can have the padding without affecting the layout of the image. This makes the button more complex than it should be.
@alice-i-cecile @ickshonpe