I'm trying to rotate a line around a point using KineticJS. But the line always rotates around the origin. I already tried using a offset, but it didn't work either.
The black point is normally positionable. I want the gray line to rotate in angles between 0 and 360 around the black point.
line.setPoints([{
x: stage.getWidth() / 2,
y: stage.getHeight() / 2
}, {
x: stage.getWidth() / 2,
y: stage.getHeight() / 2 - 30
}]);
line.transitionTo({
rotation: angle,
duration: 1,
easing: 'ease-out'
});
Any ideas?
I made a fiddle: http://jsfiddle.net/QuT4d/