简体   繁体   中英

How do I make custom (print) text draggable in Raphael JS 2.0?

I recently updated to Raphael JS 2.0 and now my text dragging is laggy.

before (1.5): http://jsfiddle.net/jedateach/vZN72/

after (2.0): http://jsfiddle.net/jedateach/YyvSm/

Perhaps someone can fork my jsfiddle to show how it should be done?

In Raphael 2.0, instead of Translate , you should make use of the Transform function, which adds a matrix transformation to the svg element.

Here is an example .

Note that the use of "..." in the transform string will append the previous transformations. If you want to store multiple transformations such as size and rotation, you'll need to store the current values, and exclude "...".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM