Skip to content

Changing costume to one with zero width or height doesn't update correctly #571

@cwillisf

Description

@cwillisf

Expected Behavior

When the user clicks a costume in the paint editor, the sprite's bounds should always be updated to match the costume.

Actual Behavior

When the user clicks a costume in the paint editor, the sprite's bounds are updated to match the costume ONLY if the new costume's width and height are both non-zero.

Steps to Reproduce

  1. Create or edit a project which uses the pen extension
  2. Make a sprite with at least two costumes:
  3. Move the rotation center outside the costume for the "normal" costume
  4. Activate the "normal" costume and use pen down and go to random position to see fencing behavior
  5. While the project is running, switch to the other costume.

Expected: the sprite (Drawable) is fenced according to the new 1x1 ImageData
Actual: the sprite (Drawable) is fenced according to the previous "good" costume

The problem goes away after using the paint editor to adjust the rotation center of the zero-width / zero-height costume.

Example (thanks @fsih!)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions