Skip to content

fix: 修复5.0.51版本create-edge连线坐标问题#7609

Merged
Aarebecca merged 2 commits intoantvis:v5from
voidman2017:fix-create-edge
Mar 30, 2026
Merged

fix: 修复5.0.51版本create-edge连线坐标问题#7609
Aarebecca merged 2 commits intoantvis:v5from
voidman2017:fix-create-edge

Conversation

@voidman2017
Copy link
Copy Markdown
Contributor

@voidman2017 voidman2017 commented Feb 4, 2026

关联 #7603 的问题。支持基础节点和自定义hmtl节点

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @voidman2017, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求解决了 G6 5.0.51 版本中 create-edge 行为在创建连线时,辅助节点坐标计算不准确的问题。通过引入客户端坐标到画布坐标的转换,确保了连线操作的精确性,提升了用户体验。

Highlights

  • 修复连线坐标问题: 在 create-edge 行为中,修正了辅助节点位置更新时,将客户端坐标错误地直接用于画布操作的问题,现在通过 graph.getCanvasByClient 转换为正确的画布坐标。
Changelog
  • packages/g6/src/behaviors/create-edge.ts
    • updateAssistEdge 方法现在使用 graph.getCanvasByClientevent.client.x, event.client.y 转换为画布坐标,再调用 model.translateNodeTo 更新辅助节点位置。
Activity
  • 目前没有人工活动。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次变更修复了 create-edge 交互中,直接使用客户端坐标更新辅助节点位置而导致的 bug。当画布发生平移或缩放等变换时,这会导致连线位置不正确。修复方案在更新节点位置前,使用 graph.getCanvasByClient 方法将客户端坐标正确地转换为了画布坐标。这是一个正确的修复,解决了坐标不一致的问题。

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.95%. Comparing base (91eb195) to head (df8ea77).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##               v5    #7609   +/-   ##
=======================================
  Coverage   94.95%   94.95%           
=======================================
  Files         188      188           
  Lines       10014    10015    +1     
  Branches     2171     2171           
=======================================
+ Hits         9509     9510    +1     
  Misses        505      505           
Flag Coverage Δ
g6 94.95% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/g6/src/behaviors/create-edge.ts 96.87% <100.00%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Aarebecca Aarebecca merged commit abbe480 into antvis:v5 Mar 30, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants