How do I apply multiple rotation transforms on a Raphael text object?
- by Pridkett
I have a Raphael text object that I would like to rotate around an axis some distance away and also rotate the text accordingly so it stays horizontal. I know this is possible using SVG transformation matrices, but the author of Raphael has stated that they won't be a part of the toolkit anytime soon. Here's some code of what I'd like to do:
txt_obj = paper.text(100, 0, "Hello!");
txt_obj.rotate(90, 100, 100); // rotate text so it is sideways at (200,100)
txt_obj.rotate(-90); // rotate text back to horizontal
Unfortunately, the second rotate command obliterates the translation and rotation accomplished by the first.
Ideally I'd like to animate the operation, but I'll take it one step at a time for right now.