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 decoration (undeline, linethrough) is wrong when direction is set to 'rtl' and align is not right #7076

Closed
hoomanaskari opened this issue May 26, 2021 · 6 comments · Fixed by #7104
Labels

Comments

@hoomanaskari
Copy link

Version

4.5.0

Test Case

https://jsfiddle.net/human_a/epfjmbot/

Information about environment

Which browsers? Chrome latest

The text decorations (undeline, linethrough) are being drawn wrong. I think the _getLineLeftOffset and getLineWidth functions are calculating it wrong. The results vary when changing text alignment too.

@asturur asturur added the bug label May 28, 2021
@asturur
Copy link
Member

asturur commented May 28, 2021

Thanks i ll look into this asap

@baras
Copy link

baras commented May 31, 2021

The results vary when changing text alignment too.

Yup, cursor position and text selection are also off when textAlign is not right.

@asturur
Copy link
Member

asturur commented Jun 1, 2021

For now RTL works with text-align right only.
Going to implement center and left later.
Or anyone can start o have a look at it.

Are you RTL users/writers? how does the implementation look like to you?

@asturur
Copy link
Member

asturur commented Jun 6, 2021

Ok now i checked the issue code sample.
Yes this is a part that hasn't been implemented yet, but we can actually fix quickly as soon as possible.
So i will mark it as feature and change the title. Was on the roadmap anyway

@asturur asturur added feature and removed bug labels Jun 6, 2021
@asturur asturur changed the title Text decoration (undeline, linethrough) is wrong when direction is set to 'rtl' Text decoration (undeline, linethrough) is wrong when direction is set to 'rtl' and align is not right Jun 6, 2021
@asturur
Copy link
Member

asturur commented Jun 6, 2021

Ok there is also a bug
image

i have a fix for the rtl/align-right with rtl text.
i can't fix for now a rtl text that then is handled as LTR from the canvas because is english text.

@asturur
Copy link
Member

asturur commented Jun 6, 2021

this pr #7104 fixes the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants