OptionaldisplayOptionaledgeWhether to scale and resize through edge lines. You can use "n", "w", "s", "e" in LineDirection array.
OptionalonWhen rotating, beforeRotate is called before rotate occurs. In beforeRotate, you can get and set the pre-value before rotating.
OptionalonWhen rotating the group, beforeRotateGroup is called before rotateGroup occurs. In beforeRotateGroup, you can get and set the pre-value before rotating.
OptionalonWhen rotating, the rotate event is called.
OptionalonWhen the rotate finishes, the rotateEnd event is called.
OptionalonWhen 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;
});
});
OptionalonWhen the group rotate finishes, the rotateGroupEnd event is called.
OptionalonWhen the group rotate starts, the rotateGroupStart event is called.
OptionalonWhen the rotate starts, the rotateStart event is called.
OptionalrenderSet directions to show the control box.
import Moveable from "@moveable-next/vanilla";
const moveable = new Moveable(document.body, {
warpable: true,
renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
});
moveable.renderDirections = ["nw", "ne", "sw", "se"];
OptionalresolveSets the control that will cause resize along with rotate. (Only Single Target, Only resizable, Beta)
OptionalrotatableWhether or not target can be rotated.
OptionalrotateYou can rotate around direction controls.
Either rotateAroundControls or displayAroundControls can be used.
OptionalrotationYou can specify the position of the rotation.
OptionalrotationSet additional rotationTargets.
Optionalthrottlethrottle of angle(degree) when rotate.
You can expand the area around the control. Either
rotateAroundControlsordisplayAroundControlscan be used. You can set the area through thecontrolPaddingvalue.