Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

移动画布后框选位置偏移 #300

Open
dandongw opened this issue Dec 23, 2024 · 4 comments
Open

移动画布后框选位置偏移 #300

dandongw opened this issue Dec 23, 2024 · 4 comments

Comments

@dandongw
Copy link

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

@leaferjs
Copy link
Owner

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

@dandongw
Copy link
Author

dandongw commented Dec 24, 2024

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)
  })
}

@leaferjs
Copy link
Owner

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

@dandongw
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants