import Moveable from "@moveable-next/vanilla";
const moveable = new Moveable(document.body, {
rotatable: true,
scalable: true,
pinchable: true, // ["rotatable", "scalable"]
});
moveable.on("pinch", ({ target }) => {
console.log(target);
});
moveable.on("rotate", ({ target }) => {
console.log(target);
});
moveable.on("scale", ({ target }) => {
console.log(target);
});
When the pinch finishes, the pinchEnd event is called.
import Moveable from "@moveable-next/vanilla";
const moveable = new Moveable(document.body, {
rotatable: true,
scalable: true,
pinchable: true, // ["rotatable", "scalable"]
});
moveable.on("pinchEnd", ({ target }) => {
console.log(target);
});
moveable.on("rotateEnd", ({ target }) => {
console.log(target);
});
moveable.on("scaleEnd", ({ target }) => {
console.log(target);
});
When the group pinch, the pinchGroup event is called.
When the group pinch finishes, the pinchGroupEnd event is called.
When the group pinch starts, the pinchGroupStart event is called.
When the pinch starts, the pinchStart event is called with part of scaleStart, rotateStart, resizeStart
import Moveable from "@moveable-next/vanilla";
const moveable = new Moveable(document.body, {
rotatable: true,
scalable: true,
pinchable: true, // ["rotatable", "scalable"]
});
moveable.on("pinchStart", ({ target }) => {
console.log(target);
});
moveable.on("rotateStart", ({ target }) => {
console.log(target);
});
moveable.on("scaleStart", ({ target }) => {
console.log(target);
});
When pinching, the pinch event is called with part of scale, rotate, resize