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

fix asymmetrical 9-slicing #14148

Merged
merged 6 commits into from
Aug 1, 2024
Merged

fix asymmetrical 9-slicing #14148

merged 6 commits into from
Aug 1, 2024

Conversation

JJJimbo1
Copy link
Contributor

@JJJimbo1 JJJimbo1 commented Jul 5, 2024

Objective

Fixes #14147.

Solution

Modify the slicing checks and algorithm to fully allow asymmetrical textures to work.
Some opinionated code cleanup.

Testing

Tested using the ui_texture_slice example and a custom asymmetrical texture.

Before:
asymmetrical_texture_slice_before

After:
asymmetrical_texture_slice_after

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets labels Jul 7, 2024
@alice-i-cecile alice-i-cecile added this to the 0.14.1 milestone Jul 7, 2024
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jul 7, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

The fix looks good to me, but I'm not keen on how fragile this code is. Can you devise some tests for this module, including a regression test?

@alice-i-cecile 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 Jul 7, 2024
@JJJimbo1
Copy link
Contributor Author

JJJimbo1 commented Jul 7, 2024

I believe the tests introduced in #13921 adequately cover this. Let me know if they don't and I'll write more extensive tests.

@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jul 7, 2024
@alice-i-cecile alice-i-cecile added the D-Straightforward Simple bug fixes and API improvements, docs, test and examples label Jul 29, 2024
@TrialDragon TrialDragon added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 1, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 1, 2024
Merged via the queue into bevyengine:main with commit 56c9d44 Aug 1, 2024
29 checks passed
mockersf pushed a commit that referenced this pull request Aug 2, 2024
# Objective

Fixes #14147.

## Solution

Modify the slicing checks and algorithm to fully allow asymmetrical
textures to work.
Some opinionated code cleanup.

## Testing

Tested using the ui_texture_slice example and a custom asymmetrical
texture.

Before:

![asymmetrical_texture_slice_before](https://github.com/bevyengine/bevy/assets/88861660/00dafce1-904a-41ac-b5d9-faaf087b0681)

After:

![asymmetrical_texture_slice_after](https://github.com/bevyengine/bevy/assets/88861660/f3d742f3-6157-4d35-b383-aee4b8f6e7d0)

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
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-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

asymmetrical 9-slicing still doesn't work if the center tile begins more than halfway from an edge
3 participants