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 can I get the correct left and top position of a text layer? #194

Open
xmejsieoke opened this issue Aug 7, 2024 · 1 comment
Open
Assignees

Comments

@xmejsieoke
Copy link

If a text layer has leading spaces, the parsed left value ignores these spaces. If I want to fully render the text using a method similar to fillText, I need to consider the pixel offset caused by the spaces. So how can I get the actual coordinates of the text, or correctly determine the center coordinates of the text?
image
image
image

@Agamnentzar Agamnentzar self-assigned this Aug 7, 2024
@Agamnentzar
Copy link
Owner

I think you need to take text.boundingBox (or maybe text.bounds not sure why there are 2 of these) and transform it using text.transform

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