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
Triangle大小、位置和其他图形有偏差 #5637
Comments
The issue you're encountering with the alignment and size discrepancies between triangles and other shapes like circles and squares in G6 seems to stem from how G6 calculates the center point and dimensions of these shapes. Each shape's center and size are determined by its SVG path and the specific commands used to draw it. For example, a circle's center is at its starting point, defined by the 'M' (move to) command, while a triangle's center can be inferred as the centroid of the points used to draw it. It's important to note that the If updating to the latest version of G6 does not resolve the issue, it might be indicative of a bug or an undocumented feature. In such cases, reporting this to the G6 repository could help address the problem more directly. Understanding how G6 interprets the Sources
|
这个应该是 4.x 版本的缺陷,不同图形对 size 的解析不一致造成的,5.x 已经修正了该问题 |
问题描述
根据文档上三角形的size是边长,复现链接里能看到等边三角形和正方形、圆形的宽度无法完全重合上,但相同size的正方形和圆形是可以正常重合的。
还有三角形和圆设置相同的x、y但实际显示中心好像对不齐,复现链接的例子放大能看到圆的中心要比三角形的中心更靠上。
是我对文档的理解有偏差吗
重现链接
https://stackblitz.com/edit/stackblitz-starters-x4xmmy?file=script.js
重现步骤
进入页面
预期行为
三角形与圆形的中心对齐、三角形的size
平台
屏幕截图或视频(可选)
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: