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

How to set text in middle when use "lineHeight" #228

Open
q1998763 opened this issue Apr 6, 2022 · 1 comment
Open

How to set text in middle when use "lineHeight" #228

q1998763 opened this issue Apr 6, 2022 · 1 comment

Comments

@q1998763
Copy link

q1998763 commented Apr 6, 2022

code:
const t = new TaggedText('hello world', {
default: {
wordWrap: true,
wordWrapWidth: 50,
valign: 'middle',
lineHeight: 50
}
}, { debug: true })

I got
image

But I want the text in vertical middle.
Sorry for my poor english.

@mimshwright
Copy link
Owner

Vertical align will change how the whole paragraph appaers within it's bounding box but doesn't work on each line. I've honestly never tried this before and I'm not sure whether it should be considered a bug.

You might try adjustBaseline to bush the line down to the middle

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