Skip to content

UI material z-offset override #20279

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Jul 25, 2025

Objective

In #20237 the swatch implementation uses a child node to display the foreground color because UI materials have a higher local z offset than everything else.

Solution

Add a stack_z_offset function to the UiMaterial trait that can be overriden to set a custom z-offset.

@ickshonpe ickshonpe requested a review from viridia July 25, 2025 00:15
@ickshonpe ickshonpe added C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy A-UI Graphical user interfaces, styles, layouts, and widgets S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 25, 2025
Copy link
Contributor

@viridia viridia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know, I was tempted to say that this change isn't necessary (for me anyway) since I worked around the issue (and might solve it a different way post-BSN). But given how simple the fix is, I don't see any reason not to approve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants