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 bug where Sprite::rect was ignored #11480

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

doonv
Copy link
Contributor

@doonv doonv commented Jan 22, 2024

Objective

#5103 caused a bug where Sprite::rect was ignored by the engine. (Did nothing)

Solution

My solution changes the way how Bevy calculates the rect, based on this table:

atlas_rect Sprite::rect Result
None None None
None Some Sprite::rect
Some None atlas_rect
Some Some Sprite::rect is used, relative to atlas_rect.min

@rparrett rparrett added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Jan 23, 2024
@rparrett rparrett added this to the 0.13 milestone Jan 23, 2024
@rparrett rparrett added the P-Regression Functionality that used to work but no longer does. Add a test for this! label Jan 23, 2024
@JMS55 JMS55 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 26, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 26, 2024
Merged via the queue into bevyengine:main with commit 7ae36a9 Jan 26, 2024
23 checks passed
tjamaan pushed a commit to tjamaan/bevy that referenced this pull request Feb 6, 2024
# Objective

bevyengine#5103 caused a bug where
`Sprite::rect` was ignored by the engine. (Did nothing)

## Solution

My solution changes the way how Bevy calculates the rect, based on this
table:

| `atlas_rect` | `Sprite::rect` | Result |

|--------------|----------------|------------------------------------------------------|
| `None` | `None` | `None` |
| `None` | `Some` | `Sprite::rect` |
| `Some` | `None` | `atlas_rect` |
| `Some` | `Some` | `Sprite::rect` is used, relative to `atlas_rect.min`
|
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 C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this! 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.

5 participants