Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Preserving sets and their free transform #17

Open

Description

@danhamlin

Hello,

I've noticed that there is no easy way to preserve a set and its free transform if it has one. I'm wondering if you've given this any thought? I've managed to accomplish this but it is fairly awkward looking code in my opinion.

Regards,
Dan H.

Activity

  1. AliasIO commented on Jan 23, 2013

    @AliasIO
    Owner

    What do you mean by "preserve a set", are you exporting/importing using Raphael.JSON?

  2. danhamlin commented on Jan 23, 2013

    @danhamlin
    Author

    Yes, using Raphael.JSON. I see in the readme it talks about preserving sets and then also a section about using it in conjunction with Raphael.FreeTransform. However, if i create a set and then FreeTransform that set. I don't see a way to preserve the set and the set's FreeTransform attributes. Only for individual items. So when i try to use FreeTransform on the set again, it is starting from a blank slate instead of from where i may have left it before serializing/deserializing. Hopefully this makes sense.

  3. AliasIO commented on Jan 23, 2013

    @AliasIO
    Owner

    You need to save the value of ft.attrs when serialising and re-apply those attributes after de-serialising. You can use ft.offset to set the initial rotation/scale/translation of the set which will fix the issue you're having. E.g. ft.offset.rotate = 45 will place the handles at a 45 degree angle without rotating the set.

  4. danhamlin commented on Jan 23, 2013

    @danhamlin
    Author

    Ah, thank you for the info. I'll give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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