When rotating the group, beforeRotateGroup is called before rotateGroup occurs. In beforeRotateGroup, you can get and set the pre-value before rotating.
When rotating, the rotate event is called.
When the rotate finishes, the rotateEnd event is called.
When the group rotate, the rotateGroup event is called.
import Moveable from "@moveable-next/vanilla";
const moveable = new Moveable(document.body, {
target: [].slice.call(document.querySelectorAll(".target")),
rotatable: true
});
moveable.on("rotateGroup", ({ targets, events }) => {
console.log("onRotateGroup", targets);
events.forEach(ev => {
const target = ev.target;
// ev.drag is a drag event that occurs when the group rotate.
const left = ev.drag.beforeDist[0];
const top = ev.drag.beforeDist[1];
const deg = ev.beforeDist;
});
});
When the group rotate finishes, the rotateGroupEnd event is called.
When the group rotate starts, the rotateGroupStart event is called.
When the rotate starts, the rotateStart event is called.
When rotating,
beforeRotateis called beforerotateoccurs. InbeforeRotate, you can get and set the pre-value before rotating.