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 on path incorrect tangent angle #6750

Closed
melchiar opened this issue Dec 23, 2020 · 6 comments · Fixed by #6755
Closed

Text on path incorrect tangent angle #6750

melchiar opened this issue Dec 23, 2020 · 6 comments · Fixed by #6755

Comments

@melchiar
Copy link
Member

Version

4.3.0

Test Case

https://jsfiddle.net/melchiar/1vdjfLc8/

Information about environment

Tested with Chrome, Firefox

Steps to reproduce

The new text on path functionality seems to be calculating tangent angle incorrectly at certain points on a curve (note the angle of the l, i, and n characters)

image

@asturur
Copy link
Member

asturur commented Dec 24, 2020

I must have broke something quick, because in the PR looked good.
I think is because i lowered the precision on the step... probably some points become the same, and the angle is then 0. That is exactly what looks like here. The angles that look off, look also 0.

@asturur
Copy link
Member

asturur commented Dec 24, 2020

There should be a way to calculate the angle on those curves without using 2 near points, i need to find out.

@asturur
Copy link
Member

asturur commented Dec 24, 2020

i think here is the answer:
https://gist.github.com/pbeshai/72c446033a98f99ce1e1371c6eee9644

@asturur
Copy link
Member

asturur commented Dec 24, 2020

image

After one our of coding...

@asturur
Copy link
Member

asturur commented Dec 24, 2020

image

Ok was a dumb error, this seems smooth.

@asturur
Copy link
Member

asturur commented Dec 24, 2020

The changes are interesting because they remove one full iteration to find the angle, compared to before.
So is more accurate and is also, let's say, double fast.

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

Successfully merging a pull request may close this issue.

2 participants