Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Picking should take the sprite's rect into consideration. #353

@Sigma-dev

Description

@Sigma-dev

Right now, Sprite picking works just fine, until you start using the sprite's optional rect property.

The rect is used in many cases, one of the most popular being getting individual frames from a spritesheet.
This results in the sprite rect and therefore the size of the actual sprite being much smaller than the bounds (that cover the whole sheet).
Since bevy_mod_picking only considers the sprite's bounds, then the sprite's actual picking zone is much bigger than it should be, rendering it unusable in many situations.

What I propose is that the bevy_mod_picking instead looks at both the bounds and the rect to determine what area is actually the sprite.

PS: I understand this might not be possible and there might be edge cases or other factors i'm not seeing. There might also be some fix/solution i'm not aware of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions