Skip to content

Cannot work with aseprite files where sprite's Canvas is resized #23

@dinghy217

Description

@dinghy217

Description

Panics when spawning a Component that utilizes an .aseprite file where a sprite's Canvas was resized (under certain conditions).

Sample Backtrace

bevy_aseprite_reader-0.1.1/src/computed.rs:765:26:
Image index (1, 9) out of bounds (11, 9)

Steps to reproduce:

  1. in examples folder, open crow.aseprite
  2. Enter canvas resize mode, Sprite (C) -> Canvas Size...
  3. Draw a bounding box starting from the top left, leave default settings, confirm, save
  4. run example
    Should see similar panic as above

Discussion

If you select

-[X] Trim content outside the canvas

the panic will not occur and behave as one would expect.

I imagine the ImageCel's untrimmed bounds are still parsed and present when the above option is not selected. Currently getting familiar with the codebase.

Is there any scenario where we are still interested in using a pixel that is out-of-bounds of the canvas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions