keep last transformations

149 views
Skip to first unread message

750

unread,
Jan 6, 2016, 6:07:47 AM1/6/16
to Raphaël
hello

I have a probleme for manipulate text (or other objects) in raphaelJs. if i rotated my object and then move (translate) it, i  lost the last rotate and the object is rotate to 0 deg.

how to keep all the last transformations.

my code  :

shape.attr({
                    transform: (shape._.transform ? "T" : "t") + deltaX+","+deltaY
                });

thank

Ian

unread,
Jan 6, 2016, 6:14:17 AM1/6/16
to Raphaël
You can build up the transform string each time....

transform: myRotateString + myTranslateString (or other way around).

Or raph can use a relative transform with 3 dots... '...' from http://raphaeljs.com/reference.html#Element.transform so '...' + myTranslateString, depending on how you want to arrange it.

Ian

750

unread,
Jan 7, 2016, 12:47:55 PM1/7/16
to Raphaël
thank , i will try it ...
Reply all
Reply to author
Forward
0 new messages