Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing costume type (SVG <-> bitmap) not working properly #2492

Open
coproc opened this issue Sep 14, 2019 · 1 comment
Open

Editing costume type (SVG <-> bitmap) not working properly #2492

coproc opened this issue Sep 14, 2019 · 1 comment

Comments

@coproc
Copy link

coproc commented Sep 14, 2019

Changing a costume's type (SVG <-> bitmap) while editing it does not work as expected. The original costume is not changed. When changing from bitmap to SVG the newly created costume is appended at the end of the list of costumes of the sprite. When changing from SVG to bitmap the newly created costume will only be selected as the active one (the sprite will "wear" it), but the new costume is not added to the available costumes of the sprite.

What could to be done to fix that:

  • When a costume's type changes while editing, a new costume (Costume or SVG_Costume) is already created. But the old costume should also be removed from the sprite's costumes.
  • The newly created costume should be added with the old name at the position in the costumes' array of the old costume.
@coproc
Copy link
Author

coproc commented Sep 16, 2019

I have a fix in my fork of Snap. But I guess my work needs a review/some feedback for further refinement before you would accept a pull request. Who can do that?

Let me give you an idea what I have been doing:
One of the problems was the asymmetric handling of bitmap and vector costumes. The vector costume was created by the bitmap editor when changing to vector type. But at this place the context of the editing (new sprite or new costume or edit existing costume) is not known. The existing callbacks only worked for some use cases (actually only for creating a new costume).

So I decided to create all editor callbacks in the gui events, where the context is known. When the costume type is changed inside an editor, the callbacks are just forwarded to the new editor. To allow this, it was also necessary to generate the costume after editing (from the data sent to the callback by the editor).

Any (constructive) feedback is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant