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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

fix asymmetrical 9-slicing #14148

wants to merge 5 commits into from

Conversation

JJJimbo1
Copy link

@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
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
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-Needs-Review Needs reviewer attention (from anyone!) to move forward
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
2 participants