antvis/G6

折线末点的位置偏移 #4865

539917729 posted onGitHub

问题描述

起点在左侧,当拖动起点上下移动,在接近中心位置时,末点位置会上下偏移。 起点在上面,当拖动起点左右移动,在接近中心位置时,末点回左右偏移。

我想从红色位置中心点出来连线

重现链接

重现步骤

预期行为

我想从红色位置中心点出来连线

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

<img width="1379" alt="截屏2023-08-29 上午11 40 18" src="https://github.com/antvis/G6/assets/25071002/0c19335a-87f0-4b16-8c19-66e346f7507e">

补充说明(可选)

No response


自定义节点的 keyShape 是否为绿色圆形。然后指定 anchorPoints https://g6.antv.antgroup.com/api/items/node-properties#anchorpoints

posted by Yanyan-Wang over 1 year ago

是的 末点就是连接的锚点。 线的类型为直线时末点位置是固定。

posted by 539917729 over 1 year ago

如果是自定义节点,确保 draw 方法返回的是这个绿色的圆形,然后指定 anchorPoints 应该可以解决

posted by Yanyan-Wang over 1 year ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests