AliasIO / Raphael.FreeTransform

Free transform tool for Raphaël elements.
http://elbertf.com
362 stars 107 forks source link

Dragging an element directly after using .hideHandles() / .showHandles() #117

Open dhardtke opened 10 years ago

dhardtke commented 10 years ago

Hi,

I know that this is not directly related to the plugin, but I don't know if I can solve this problem I have without people that know this plugin.

So I have a "mousedown", "mousemove" and "mouseup" listener listening on the svg html element (the paper in fact).

I have all the freeTransform handlers hidden at first and enable them, if an element gets selected within a mousedown handler.

Now I want to let the user immediately drag an element after he selected it. How can I do that? I tried almost everything, but nothing is working.

I can not get it working that I let FreeTransform do it's drag magic right before I've shown the handles, right now I always have to release the left mouse button before I can drag an element.

Any idea?

Thanks a lot!

jwarren1980 commented 10 years ago

When you hide the handles on the freeTransform elements for the first time, hide them with the undrag option set to false. This tells freeTransform that you want to remove the handles on the item, but still want it to respond to any drag events.

var ft = paper.freeTransform(rect);

ft.hideHandles({ undrag: false });