X6 icon indicating copy to clipboard operation
X6 copied to clipboard

2.16.1版本,blank:mousewheel事件不被触发

Open Echo-pain-killer opened this issue 1 year ago • 3 comments

Describe the bug

在之前的2.15版本,我将画布的mousewheel禁用掉以后,自己监听blank:mousewheel事件来完成需求。当我升级到2.16.1后,发现blank:mousewheel事件不被触发了。


const graph = new Graph({
    mousewheel: false,
    ...
})

graph.on('blank:mousewheel',(e) => {
    console.log(e)
})

Your Example Website or App

...

Steps to Reproduce the Bug or Issue


const graph = new Graph({
    mousewheel: false,
    ...
})

graph.on('blank:mousewheel',(e) => {
    console.log(e)
})

Expected behavior

希望能看到事件被正确的触发

Screenshots or Videos

No response

Platform

  • OS: [Windows,]
  • Browser: [ Chrome]
  • Version: [2.16.1]

Additional context

No response

Echo-pain-killer avatar Dec 26 '23 02:12 Echo-pain-killer

👋 @Echo-pain-killer

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

x6-bot[bot] avatar Dec 26 '23 02:12 x6-bot[bot]

我的是只要开启滚轮缩放,事件就不触发了。大佬最后是怎么解决的?

   mousewheel: {
     enabled: true
   },

zlecheng avatar Jun 28 '24 01:06 zlecheng

有解决方案了,改成下面这个事件就行了

graph.on('scale', ({ sx, sy, ox, oy }) => {})

zlecheng avatar Jun 28 '24 02:06 zlecheng