bevy/crates/bevy_sprite
andriyDev d2debf2cc9 Fix sprite picking backend not considering the viewport of the camera. (#16386)
# Objective

- When picking sprites, the pointer is offset from the mouse, causing
you to pick sprites you're not mousing over!

## Solution

- Shift over the cursor by the minimum of the viewport.

## Testing

- I was already using the bevy_mod_picking PR for my project, so it
seems to work!
- I tested this on the sprite_example (making the camera only render to
part of the viewport), and it also works there.

## Notes

- This is just https://github.com/aevyrie/bevy_mod_picking/pull/365 but
in Bevy form.
- We don't need to renormalize the viewport in any way since the
viewport is specified in pixels, so all that matters is that the origin
is correct.

Co-authored-by: johanhelsing <johanhelsing@gmail.com>
2024-11-16 15:31:38 +01:00
..
src Fix sprite picking backend not considering the viewport of the camera. (#16386) 2024-11-16 15:31:38 +01:00
Cargo.toml Don't reëxport bevy_image from bevy_render (#16163) 2024-11-11 22:16:38 +01:00
README.md Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00

Bevy Sprite

License Crates.io Downloads Docs Discord