OptionaldisplayOptionaledgeWhether to scale and resize through edge lines. You can use "n", "w", "s", "e" in LineDirection array.
OptionalonWhen warping, the warp event is called.
import Moveable from "@moveable-next/vanilla";
let matrix = [
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
];
const moveable = new Moveable(document.body, { warpable: true });
moveable.on("warp", ({ target, transform, delta, multiply }) => {
// target.style.transform = transform;
matrix = multiply(matrix, delta);
target.style.transform = `matrix3d(${matrix.join(",")})`;
});
OptionalonWhen the warp finishes, the warpEnd event is called.
OptionalonWhen the warp starts, the warpStart 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"];
OptionalwarpableWhether or not target can be warped.
You can expand the area around the control. Either
rotateAroundControlsordisplayAroundControlscan be used. You can set the area through thecontrolPaddingvalue.