Open miina opened 2 years ago
@miina
you can use setFixedDirection on rotateStart
https://daybrush.com/moveable/storybook2/?path=/story/advanced-rotatable--rotate-with-custom-origin
@miina
you can use setFixedDirection on rotateStart
https://daybrush.com/moveable/storybook2/?path=/story/advanced-rotatable--rotate-with-custom-origin
Ah, thank you, I saw the storybook in the code for it but didn't find the story for some reason, wasn't sure it was for that. Does setFixedDirection
use pixels as unit? Or looking at the code perhaps values from -1 to 1 where [0, 0] is the center, [-1, -1] is the left top?
@miina
Since it is a direction, it is determined according to the direction and is relative to offsetWidth and offsetHeight.
[0, 0] is center [-1, -1] left, top [1, -1] right top [-1, 1] left bottom [1, 1,] right bottom
@daybrush
Since it is a direction, it is determined according to the direction and is relative to offsetWidth and offsetHeight.
[0, 0] is center [-1, -1] left, top [1, -1] right top [-1, 1] right bottom [1, 1,] right bottom
[-1, 1] right bottom
is it suppose to be left bottom
?
@ngocducdim
right. my typo
Environments
Description
Is it possible to change the center of the rotation? For example if instead of rotating around the center of the target, I'd like to rotate the element around a point [x, y] within the element?