Raphael.FreeTransform icon indicating copy to clipboard operation
Raphael.FreeTransform copied to clipboard

adding option for handle

Open slowdash opened this issue 11 years ago • 3 comments

Anybody tried repositioning the handles? eg: put the handles on the sides of the box instead of just the x & y discs

slowdash avatar Mar 06 '14 07:03 slowdash

You mean like the example on the right? It's the draw: [ 'bbox' ] option with scale: [ 'bboxSides' ].

https://raw.github.com/ElbertF/Raphael.FreeTransform/master/screenshot.png

AliasIO avatar Mar 06 '14 07:03 AliasIO

hi Elbert,

first, i want to say thanks for a really great script

well, im trying to use images instead of the x,y discs to seperate the functionality for dragging and resizing, the positions of the handles are on the edges of the box much like the example you gave

i basically just cloned the function for drag but cant seem to figure out how to accomodate the change of location for the handle,

already changed

var cx = dx + ft.handles[axis].disc.ox, cy = dy + ft.handles[axis].disc.oy;

to point to the handles i created instead, but cant seem to get the proper formula to compute the radian

var rad = Math.atan2(cy - ft.o.center.y - ft.o.translate.y, cx - ft.o.center.x - ft.o.translate.x);

slowdash avatar Mar 06 '14 07:03 slowdash

Hi Slowdash, do you have any sample code to share about how you did it? Currently I am trying to move the center-right disc to the top-left corner.

Thanks in advance.

jorozcocs avatar Aug 04 '14 17:08 jorozcocs