-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
UI borders and outlines clipping fix #16044
Merged
alice-i-cecile
merged 7 commits into
bevyengine:main
from
ickshonpe:fix-border-and-ioutlines-clipping
Oct 21, 2024
Merged
UI borders and outlines clipping fix #16044
alice-i-cecile
merged 7 commits into
bevyengine:main
from
ickshonpe:fix-border-and-ioutlines-clipping
Oct 21, 2024
+23
−8
Conversation
This file contains 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
ickshonpe
changed the title
UI bordering and outlines clipping fix
UI borders and outlines clipping fix
Oct 21, 2024
ickshonpe
added
A-UI
Graphical user interfaces, styles, layouts, and widgets
A-Rendering
Drawing game state to the screen
C-Bug
An unexpected or incorrect behavior
labels
Oct 21, 2024
I'll update the docs for the new paramater in a few hours, got some errands I need to run. |
ickshonpe
added
the
S-Needs-Review
Needs reviewer attention (from anyone!) to move forward
label
Oct 21, 2024
BenjaminBrienen
approved these changes
Oct 21, 2024
alice-i-cecile
added
S-Waiting-on-Author
The author needs to make changes or address concerns before this can be merged
and removed
S-Needs-Review
Needs reviewer attention (from anyone!) to move forward
labels
Oct 21, 2024
JMS55
approved these changes
Oct 21, 2024
…m/ickshonpe/bevy into fix-border-and-ioutlines-clipping
ickshonpe
removed
the
S-Waiting-on-Author
The author needs to make changes or address concerns before this can be merged
label
Oct 21, 2024
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
Oct 21, 2024
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
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
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
fixes #15502
Clipped borders and outlines aren't drawn correctly.
Borders aren't clipped
Spawn two nodes with the same dimensions and border thickness, but clip on of the nodes so that only its top left quarter is visible:
You can see that instead of clipping the border, instead the border is scaled to fit inside of the unclipped section.
You can also see this problem in the
overflow
example. If you hover over any of the clipped nodes you'll see that the outline only wraps the visible section of the nodeOutlines are clipped incorrectly
A UI nodes Outline's are drawn outside of its bounds, so applying the local clipping rect to the outline doesn't make any sense.
Instead an
Outline
should be clipped using its parent's clipping rect.Solution
point
value into the vertex shader instead of calculating it in the shader.extract_uinode_borders
use the parents clipping rect when clipping outlines.The extra parameter isn't a great solution I think, but I wanted to fix borders for the 0.15 release and this is the most minimal approach I could think of without replacing the whole shader and prepare function.
Showcase