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 Not Vertically Aligned #31

Open
nomaam opened this issue Feb 11, 2022 · 0 comments
Open

Text Not Vertically Aligned #31

nomaam opened this issue Feb 11, 2022 · 0 comments

Comments

@nomaam
Copy link

nomaam commented Feb 11, 2022

Great code, thanks for making it. Everything works well, but the text will not vertically align centre.

All of my text is slightly lower than centre, and I have confirmed there is no other css markup effecting the element.

Is there a way to modify or set an off-set to adjust vertical alignment?

For example

<text x="50%" y="16" font-family="inherit" font-size="1rem" font-weight="inherit" style="text-anchor:middle">test</text>

Changing y=16 to y=15 fixes the problem for me. But perhaps there is a way to do this through your fitter function?? Otherwise I would have to call a custom function to modify this value on all elements.

Thanks.

=== update ===

I probably should have looked into your code before posting a question. Changing the following fixed things for me. Hopefully others find it useful.

i = e.baseline || 15, //baseline original code was 16

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

1 participant