daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!

Home Page:https://daybrush.com/moveable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to remove origin red dot ?

vaynevayne opened this issue · comments

Environments

  • Framework name: moveable
  • Framework version: 0.53.0
  • Moveable Component version:
  • Testable Address(optional):
image

Description

const moveableRef = new Moveable(this.minimapContainerDom, {
      target: this.viewportDom,
      draggable: true,
      snappable: true, // 搭配bounds使用
      // scalable: true, // 暂不支持
      bounds: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
        position: 'css',
      },
    });
    moveableRef
      .on('dragStart', () => {
        this.options.refresh = false;
      })
      .on('drag', (e) => {
        const camera = this.context.canvas.getCamera();
        const zoom = Math.pow(2, camera.getZoom());
        camera.pan(e.delta[0] / this.ratio / zoom, e.delta[1] / this.ratio / zoom);

        e.target.style.transform = e.transform;
      })
      .on('dragEnd', () => {
        this.options.refresh = rawRefresh;
      });