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

selection 插件 edge 选择框 显示位置不对 #4280

Open
light-years-run opened this issue Apr 25, 2024 · 0 comments
Open

selection 插件 edge 选择框 显示位置不对 #4280

light-years-run opened this issue Apr 25, 2024 · 0 comments

Comments

@light-years-run
Copy link

Describe the bug

自定义节点 markup时候,子元素设置magnet ,然后子元素拖拽出连接线,点击连接线,连接线的框选框位置偏移
image
image

Your Example Website or App

代码如下

Steps to Reproduce the Bug or Issue

import { Graph } from '@antv/x6'
import { Selection } from '@antv/x6-plugin-selection'
import { Transform } from '@antv/x6-plugin-transform'
const graph = new Graph({
container: document.getElementById('container'),
grid: true,
})
graph.use(
new Selection({
enabled: true,
multiple: true,
rubberband: true,
movable: true,
showNodeSelectionBox: true,
showEdgeSelectionBox: true,
}),
)
graph.use(
new Transform({
resizing: true,
rotating: true,
}),
)

graph.addNode({
x: 0,
y: 0,
width: 96,
height: 96,
markup: [
{
tagName: 'path',
selector: 'eye1',
groupSelector: 'eye',
attrs: {
d: 'M24.82,48.678c5.422,0,9.832-6.644,9.832-14.811c0-8.165-4.41-14.809-9.832-14.809s-9.833,6.644-9.833,14.809C14.987,42.034,19.399,48.678,24.82,48.678z',
},
},
{
tagName: 'path',
selector: 'eye2',
groupSelector: 'eye',
attrs: {
d: 'M71.606,48.678c5.422,0,9.833-6.644,9.833-14.811c0-8.165-4.411-14.809-9.833-14.809c-5.421,0-9.831,6.644-9.831,14.809C61.775,42.034,66.186,48.678,71.606,48.678z',
magnet:true
},
},
{
tagName: 'path',
selector: 'lip',
attrs: {
d: 'M95.855,55.806c-0.6-0.605-1.516-0.77-2.285-0.4C81.232,61.29,65.125,64.53,48.214,64.53c-16.907,0-33.015-3.24-45.354-9.123c-0.77-0.367-1.688-0.205-2.284,0.4c-0.599,0.606-0.747,1.526-0.369,2.29c5.606,11.351,25.349,19.277,48.008,19.277c22.668,0,42.412-7.929,48.012-19.279C96.603,57.332,96.453,56.411,95.855,55.806z',
},
},
],
attrs: {
lip: {
fill: '#E0A31A',
},
eye: {
fill: '#730000',
},
},
})
graph.addNode({
x: 520,
y: 0,
width: 96,
height: 96,
markup: [
{
tagName: 'path',
selector: 'eye1',
groupSelector: 'eye',
attrs: {
d: 'M24.82,48.678c5.422,0,9.832-6.644,9.832-14.811c0-8.165-4.41-14.809-9.832-14.809s-9.833,6.644-9.833,14.809C14.987,42.034,19.399,48.678,24.82,48.678z',
magnet:true
},
},
{
tagName: 'path',
selector: 'eye2',
groupSelector: 'eye',
attrs: {
d: 'M71.606,48.678c5.422,0,9.833-6.644,9.833-14.811c0-8.165-4.411-14.809-9.833-14.809c-5.421,0-9.831,6.644-9.831,14.809C61.775,42.034,66.186,48.678,71.606,48.678z',
},
},
{
tagName: 'path',
selector: 'lip',
attrs: {
d: 'M95.855,55.806c-0.6-0.605-1.516-0.77-2.285-0.4C81.232,61.29,65.125,64.53,48.214,64.53c-16.907,0-33.015-3.24-45.354-9.123c-0.77-0.367-1.688-0.205-2.284,0.4c-0.599,0.606-0.747,1.526-0.369,2.29c5.606,11.351,25.349,19.277,48.008,19.277c22.668,0,42.412-7.929,48.012-19.279C96.603,57.332,96.453,56.411,95.855,55.806z',
},
},
],
attrs: {
lip: {
fill: '#E0A31A',
},
eye: {
fill: '#730000',
},
},
})

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

d

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

1 participant