Skip to content
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

Text不设置高度时,实例化后通过 text.height 的值为 0 #325

Open
zhaohuaishuai opened this issue Jan 11, 2025 · 3 comments
Open

Comments

@zhaohuaishuai
Copy link

我在拼接一张长图,需要用到文字的高度来确定下一张图片的y值,可是我取到的值是0

@zhaohuaishuai
Copy link
Author

我用的是这个 @leafer-ui/node 1.3.2版本
和 skia-canvas

@leaferjs
Copy link
Owner

leaferjs commented Jan 13, 2025

没有设置宽高的·元素打印宽高无效,需要获取布局后的元素包围盒,打印一下 text.boxBounds, 或者 text.getBounds('content', 'inner')

@zhaohuaishuai
Copy link
Author

噢,好的谢谢。这个引擎真的不错。赞!

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

No branches or pull requests

2 participants