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

对齐线一个bug #3974

Open
wtjperi2003 opened this issue Oct 16, 2023 · 0 comments
Open

对齐线一个bug #3974

wtjperi2003 opened this issue Oct 16, 2023 · 0 comments
Labels
type: bug 缺陷 Defects and unexpected behaviors

Comments

@wtjperi2003
Copy link

wtjperi2003 commented Oct 16, 2023

Describe the bug

对齐线里默认把画布上的mouseup和touchend事件隐藏了。会导致自己添加到document上的mouseup事件全部失效,代码如下:
image
另外,对齐线插件能否添加一个过滤掉不需要对齐的节点的过滤器。当前的过滤器时过滤掉被对齐的节点。

Your Example Website or App

https://x6.antv.antgroup.com/examples/node/native-node#image

Steps to Reproduce the Bug or Issue

import { Graph } from '@antv/x6'
import {Snapline} from '@antv/x6-plugin-snapline'
const graph = new Graph({
  container: document.getElementById('container'),
  grid: true,
})
graph.use(
          new Snapline({
            enabled: true,
            sharp:false
          }),
      )
const node=graph.addNode({
  shape: 'image',
  x: 320,
  y: 120,
  width: 94,
  height: 28,
  imageUrl:
    'https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg',
})
function mouseup(){
  node.prop('position/x',node.prop('position/x')+10)
}
document.removeEventListener('mouseup',mouseup)
document.addEventListener('mouseup',mouseup)
  1. 点击非画布区域,节点会向右移动
  2. 点击画布区域,会发现节点不动

Expected behavior

希望解决下这个问题

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 2.11.1]

Additional context

No response

@NewByVector NewByVector added the type: bug 缺陷 Defects and unexpected behaviors label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 缺陷 Defects and unexpected behaviors
Projects
None yet
Development

No branches or pull requests

2 participants