We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
label 使用padding并且折行的情况下,background宽度不能覆盖全部文字内容。
查看了下 label.ts 源码,这里宽度的计算好像有点问题。
Object.assign(backgroundStyle, { x: minX - left, y: minY - top, width: wordWrap ? Math.min(totalWidth, wordWrapWidth) : totalWidth, height: halfHeight * 2 + top + bottom, });
是不是可以改成 width: wordWrap ? Math.min(totalWidth, wordWrapWidth + left + right) : totalWidth,
或者不做判断直接用 totalWidth 好像也可以 width: totalWidth
🆕 5.x
macOS
Chrome
No response
The text was updated successfully, but these errors were encountered:
看起来应该是需要改为:
width: wordWrap ? Math.min(totalWidth, wordWrapWidth + left + right) : totalWidth,
有兴趣给 G6 提个 PR 吗
Sorry, something went wrong.
No branches or pull requests
Describe the bug / 问题描述
label 使用padding并且折行的情况下,background宽度不能覆盖全部文字内容。
查看了下 label.ts 源码,这里宽度的计算好像有点问题。
Object.assign(backgroundStyle, {
x: minX - left,
y: minY - top,
width: wordWrap ? Math.min(totalWidth, wordWrapWidth) : totalWidth,
height: halfHeight * 2 + top + bottom,
});
是不是可以改成
width: wordWrap ? Math.min(totalWidth, wordWrapWidth + left + right) : totalWidth,
或者不做判断直接用 totalWidth 好像也可以
width: totalWidth
G6 Version / G6 版本
🆕 5.x
Operating System / 操作系统
macOS
Browser / 浏览器
Chrome
Additional context / 补充说明
No response
The text was updated successfully, but these errors were encountered: