antvis/G6



The issue has been closed
[v5] toolbar自带工具栏点击放大缩小导致label标签内容位置偏移 #5529
holddididi posted onGitHub
问题描述
toolbar在画布中使用Zoom放大缩小后在点击toolbar中的放大缩小按钮就导致节点label标签位置偏移
重现链接
none
重现步骤
1.进入 https://g6-next.antv.antgroup.com/examples/tool/toolbar/#toolbar 页面 2.配置页面元素添加label标签
new Graph({
container,
width,
height,
data,
layout,
node:{
labelShape: {
text: {
fields: ['id'],
formatter: (model) => model.id,
},
position: 'top',
},
},
modes: {
default: ['drag-canvas', 'drag-node', 'zoom-canvas'],
},
plugins: [{ type: 'toolbar', key: 'toolbar-1' }],
});
3.使用zoom放大/缩小画布 4.点击toolbar的放大/缩小按钮 5. label标签位置偏移
预期行为
点击放大缩小按钮label位置不偏移
平台
- 操作系统: Windows
- 网页浏览器: Google Chrome
- G6 版本: 5.0.0-beta.28
屏幕截图或视频(可选)
<img width="1356" alt="image" src="https://github.com/antvis/G6/assets/54901770/b3537a2e-a9c6-4263-b842-307ffb717af5">
补充说明(可选)
No response