-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
measureText make actualBoundingBoxRight
mistake when textAlign is center
#1909
Comments
zbjornson
added a commit
that referenced
this issue
Sep 4, 2022
This bug goes back 10 years to the original implementation. Fixes #1909
zbjornson
added a commit
that referenced
this issue
Sep 4, 2022
This bug goes back 10 years to the original implementation. Fixes #1909
zbjornson
added a commit
that referenced
this issue
Sep 4, 2022
This bug goes back 10 years to the original implementation. Fixes #1909
zbjornson
added a commit
that referenced
this issue
Sep 4, 2022
This bug goes back 10 years to the original implementation. Fixes #1909
zbjornson
added a commit
that referenced
this issue
Sep 4, 2022
This bug goes back 10 years to the original implementation. Fixes #1909
1 task
chearon
pushed a commit
that referenced
this issue
Sep 6, 2022
This bug goes back 10 years to the original implementation. Fixes #1909
This was referenced Jun 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when I set
ctx.textAlign = 'center'
, then callmeasureText
, will get wrongactualBoundingBoxRight
result.Steps to Reproduce
Here is the result screenshot when using node-canvas:
And here is the screenshot when run on Chrome:
It seem that, the correct way to get
actualBoundingBoxRight
isactualBoundingBoxRight @ center align
=actualBoundingBoxRight @ left align
-width / 2
but now use
actualBoundingBoxRight @ center align
=actualBoundingBoxRight @ left align
+width / 2
Your Environment
The text was updated successfully, but these errors were encountered: