leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

移动画布后框选位置偏移

Open dandongw opened this issue 1 year ago • 4 comments

moveWorld 或者 move 后,框选区域偏移。

dandongw avatar Dec 23 '24 09:12 dandongw

请提供能复现问题的运行代码,正常情况下测不出来~

leaferjs avatar Dec 24 '24 00:12 leaferjs

function initLeafer() {
  leaferApp = new App({
    view: leaferViewRef.value as HTMLHtmlElement,
    zoom: { min: 0.5, max: 5 },
    editor: {
      moveable: false,
      resizeable: false,
      flipable: false,
      rotateable: false,
      skewable: false,
    },
    sky: {},
    tree: { type: 'custom' },
    ground: {},
    smooth: true,
    mobile: false,
  })
  leaferApp.on(MoveEvent.BEFORE_MOVE, function (e: MoveEvent) {
    leaferApp.tree.moveWorld(e.moveX, 0)
  })
}

dandongw avatar Dec 24 '24 01:12 dandongw

应该是监听 leaferApp.tree, 而不是leaferApp

leaferjs avatar Dec 25 '24 01:12 leaferjs

引入了@leafer-in/scroll就正常了,不引入就会偏移

dandongw avatar Dec 27 '24 01:12 dandongw