Moveable
    Preparing search index...

    Interface WarpableProps

    interface WarpableProps {
        displayAroundControls?: boolean;
        edge?: boolean | LineDirection[];
        onWarp?: (e: OnWarp) => any;
        onWarpEnd?: (e: OnWarpEnd) => any;
        onWarpStart?: (e: OnWarpStart) => any;
        renderDirections?: boolean | string[];
        warpable?: boolean;
    }

    Hierarchy (View Summary)

    Index
    displayAroundControls?: boolean

    You can expand the area around the control. Either rotateAroundControls or displayAroundControls can be used. You can set the area through the controlPadding value.

    0.44.0

    false
    
    edge?: boolean | LineDirection[]

    Whether to scale and resize through edge lines. You can use "n", "w", "s", "e" in LineDirection array.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);
    moveable.edge = true;
    onWarp?: (e: OnWarp) => any

    When 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(",")})`;
    });
    onWarpEnd?: (e: OnWarpEnd) => any

    When the warp finishes, the warpEnd event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, { warpable: true });
    moveable.on("warpEnd", ({ target, isDrag }) => {
    console.log(target, isDrag);
    });
    onWarpStart?: (e: OnWarpStart) => any

    When the warp starts, the warpStart event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, { warpable: true });
    moveable.on("warpStart", ({ target }) => {
    console.log(target);
    });
    renderDirections?: boolean | string[]

    Set directions to show the control box.

    false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise
    
    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"];
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    scalable: true,
    renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
    });

    moveable.renderDirections = ["nw", "ne", "sw", "se"];
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    resizable: true,
    renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
    });

    moveable.renderDirections = ["nw", "ne", "sw", "se"];
    warpable?: boolean

    Whether or not target can be warped.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.warpable = true;