Skip to content
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

custom_ui_material border fix #17282

Merged

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Jan 10, 2025

Objective

The order of the border edges in UiVertexOutput is left, right, top, bottom but in custom_ui_material the selectors switch them so left is right and top is bottom.

Solution

Reverse the conditions so that the correct border values are selected.

…ttom but in `custom_ui_material` the selectors switch them so left is right and top is bottom. Reversed the conditions so the correct edge values are selected.
@ickshonpe ickshonpe changed the title `ui_material custom_ui_material border fix Jan 10, 2025
@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets D-Shaders This code uses GPU shader languages labels Jan 10, 2025
Copy link
Contributor

@rparrett rparrett left a comment

Choose a reason for hiding this comment

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

Confirmed issue and fix by modifying the ui_material example.

border: UiRect {
    top: Val::Px(20.),
    left: Val::Px(20.),
    bottom: Val::Px(10.),
    right: Val::Px(10.),
},

Since you seem to understand this shader code, maybe you could sprinkle a few comments and/or expand the mysterious one letter variable names while you're in there?

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jan 11, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 11, 2025
Merged via the queue into bevyengine:main with commit 51c3bf2 Jan 11, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior D-Shaders This code uses GPU shader languages D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants