javascript - raphael move set multiple times -
I have a set of circles, rectangular and text
I take it to a specific location I can (50 points to the right) like this:
object.entireSet.transform ("T50,0"); And it works just fine
Now I want to move it again (right again 50 points)
Object wholeSet.transform ("T50,0"); But the object remains in one place. If I want to take it as I want, then I have to type the command like this
object.entireSet.transform ("T100,0"); So I think that Raphael somehow remembers the original change (0,0) change and hence (T050) will always go to the same point. Do you know how to reset the change, so the following code
object.entireSet.transform ("T50,0"); // First Step Object Entertainment. Transform ("T50,0"); // second move will be the result of an object for the point (x, y) to the point (x + 50, y) and then (x + 100, y)?
You can find the solution in the document:
set.transform ("T50,0"); Set.transform ("... t50,0"); // This first change adds to JSField:
EDIT: I realized that you may need some more explanations to understand Why Your code is not working. It is to do with RAFEL's SVG nature. You may want to quickly learn the basics of SVG to understand the functioning of some Rafael.
You call all the changes on the same element, in fact, update the value of a string, which is used for ... to transform it.
When you do this:
set.transform ("T50,0"); Set.transform ("T50,0"); The value of the string after the first call is "T50,0", you want to rewrite this with the second call ==> Its value is still "T50,0" in the end, this is the reason why it does not change.
When you do this:
set.transform ("T50,0"); Set.transform ("... t50,0"); The value of the string becomes more or less: "T50,0t50,0" which means in Raphael: translate y to 50 on x and 0, THEN < / Strong> Y on 50 and X on 0. To clarify this, I updated my belly. You can find it in different change calls which I hope will help you to understand how it works.
Comments
Post a Comment