You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
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.
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.
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.
Activity
AliasIO commentedon Jan 23, 2013
What do you mean by "preserve a set", are you exporting/importing using Raphael.JSON?
danhamlin commentedon Jan 23, 2013
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.
AliasIO commentedon Jan 23, 2013
You need to save the value of
ft.attrswhen serialising and re-apply those attributes after de-serialising. You can useft.offsetto set the initial rotation/scale/translation of the set which will fix the issue you're having. E.g.ft.offset.rotate = 45will place the handles at a 45 degree angle without rotating the set.danhamlin commentedon Jan 23, 2013
Ah, thank you for the info. I'll give it a try.