Skip to content

Fix bevy_picking sprite backend panic in out of bounds atlas index#15202

Merged
alice-i-cecile merged 2 commits intobevyengine:mainfrom
s-puig:fix-picking-panic
Sep 30, 2024
Merged

Fix bevy_picking sprite backend panic in out of bounds atlas index#15202
alice-i-cecile merged 2 commits intobevyengine:mainfrom
s-puig:fix-picking-panic

Conversation

@s-puig
Copy link
Copy Markdown
Contributor

@s-puig s-puig commented Sep 14, 2024

Objective

  • Fix panic when atlas index is out of bounds
  • Took the chance to clean it up a bit

Solution

  • Use texture dimensions like rendering pipeline. Dropped atlas layouts and indexes out of bounds are shown as a sprite.

Testing

Used sprite_picking example, drop layout and/or use indexes out of bounds.

@alice-i-cecile alice-i-cecile added this to the 0.15 milestone Sep 14, 2024
@mnmaita mnmaita added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 17, 2024
Copy link
Copy Markdown
Member

@mnmaita mnmaita left a comment

Choose a reason for hiding this comment

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

Code looks good, nice cleanup. Leaving a very minor optional nit.

@IceSentry IceSentry 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 Sep 26, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 30, 2024
Merged via the queue into bevyengine:main with commit 4a1645b Sep 30, 2024
robtfm pushed a commit to robtfm/bevy that referenced this pull request Oct 4, 2024
…evyengine#15202)

# Objective

- Fix panic when atlas index is out of bounds
- Took the chance to clean it up a bit

## Solution

- Use texture dimensions like rendering pipeline. Dropped atlas layouts
and indexes out of bounds are shown as a sprite.

## Testing

Used sprite_picking example, drop layout and/or use indexes out of
bounds.
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 S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants