BigBadaboom / androidsvg

SVG rendering library for Android
http://bigbadaboom.github.io/androidsvg/
Apache License 2.0
1.21k stars 231 forks source link

Rendering of text-anchor="middle" wrong in case of a very small font size #195

Closed vesselink closed 4 years ago

vesselink commented 4 years ago

The font size in the attached svg is super small (0.06) so measureText is unusable. Will add a pull request with a proposal to fix the issue.

FastStart_Autocad.zip

BigBadaboom commented 4 years ago

Thanks very much! I'll make sure this gets merged into the next release.

BigBadaboom commented 4 years ago

Fixed.

Fix for right and center alignment of text with very small font sizes. Android's Paint.measureText() returns widths that are too large because it rounds up fractional results. Thanks to @vesselink for the fix!