antvis / X6

🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
https://x6.antv.antgroup.com
MIT License
5.52k stars 1.66k forks source link

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

Open Echo-pain-killer opened 6 months ago

Echo-pain-killer commented 6 months ago

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

Additional context

No response

x6-bot[bot] commented 6 months ago

👋 @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.

zlecheng commented 1 week ago

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

   mousewheel: {
     enabled: true
   },
zlecheng commented 1 week ago

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

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