-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Path 画圆弧, 属性d 改为refD后,图形变形 #3909
Comments
refD 是相对的 d,和 d 本身就不是一致的。 |
是的refD是相对的d,但是从官网给的例子和文档看,当refD和d路径点一致时,refD成图效果和d是一致的,只是d不会跟随图形缩放,refD可以,按照您的回复,refD难道和d成图效果会有偏差吗?那我用refD改怎么绘制出一个半椭圆呢? |
我用的是 path中的 A绘制的椭圆,是否是因为 X6将A转成了C造成的呢? |
X6 中 path 对 A 支持不太好,可以使用下面方式规避: // M517.73,241.31 L703.9,438.12 A270.91 270.91 0 1 1 732.73,406.14Z
const d = new Path()
.moveTo(517.73, 241.31)
.lineTo(703.9, 438.12)
.arcTo(270.91, 270.91, 0, 0, 1, 732.73, 406.14)
.close()
.serialize(); |
非常好用,感谢 |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
问题描述
用画弧度方式绘制了一个圆,d属性可以正常显示,修改为refD后,变形
只有在大角度的时候才有此问题,比如超过180度,小角度,锐角的时候没有问题
d属性时
refD 时:
重现链接
代码如下
重现步骤
import { Graph } from '@antv/x6'
const graph = new Graph({
container: document.getElementById('container'),
grid: true,
})
graph.addNode({
shape: 'path',
x: 0,
y: 0,
width: 541.82,
height: 541.82,
label: 'path',
attrs: {
body: {
fill: '#efdbff',
stroke: '#9254de',
// 指定 refD 属性,pathData 随图形大小自动缩放
// https://x6.antv.vision/zh/docs/api/registry/attr#refdresetoffset
},
})
预期行为
希望refD和 d一致
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: