-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
impr(tape mode): support RTL languages (@NadAlaba) #5748
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
base: master
Are you sure you want to change the base?
Conversation
This PR is stale. Please trigger a re-run of the PR check action. |
Weird issue i ran into when testing this (sometimes words are slow to appear on the right) Screen.Recording.2024-08-23.at.14.49.04.mov |
Resolved! Please merge #5824 before this to perform final test on this one. |
This PR is stale. Please trigger a re-run of the PR check action. |
This is built on top of #5868, so it'd be easier to review that PR first |
3c4b9b1
to
7b14235
Compare
35bbcbf
to
211a24a
Compare
This PR is stale. Please trigger a re-run of the PR check action. |
589d113
to
5bcd1e5
Compare
40fda7e
to
127c3c9
Compare
e3ccac2
to
c65877f
Compare
Description
Support RTL in tape mode:
scrollTape()
: flip the sign of#words.margin-left
and add.word.margin-right
to center first letter in RTL.Caret.getTargetPositionLeft()
: flip the direction of tapeMargin in RTL.Support zero-width characters in tape mode:
scrollTape()
when tape=letter.Remove the width change of
#words
in tape mode to 200vw because it's not needed anymore now that we're usingwhite-space: nowrap
:.afterNewline.margin-left
to be 3 times the new width of#words
which is now equal to#wordsWrapper.width
by default.Make
.word.height
in.withLigature
langs similar to their height in english:inline-block
<letter>
s in.withLigatures
lanuages. These languages make the display of<letter>
elementsinline
in order to allow the joining of letters. However, this causes<letter>
'sborder-bottom
to be ignored, which changes.word
height, so we add apadding-bottom
to the.word
in that case.inline
<letter>
s overflow the#wordWrapper
without wrapping (e.g, whenmaxLineWidth
= 20ch and we type 30 letters), so we add the propertyoverflow-wrap: anywhere
, but we don't allow.hints
to inherit this property..word
s have the same height (with and without ligatures), because we now set the height of.beforeNewline
s in css, and we depend on these elements to have the same height as.word
s so that the user won't feel a vertical shift in lines in tape mode.Animate turning off tape mode in
updateWordsMargin()
ifSmoothLineScroller
is on.Block removing words at the first call of
scrollTape()
:#words.margin-left
may be negative when restarting the test, makingscrollTape()
start when the first word is overflown to the left, which makesscrollTape()
remove that word (this bug affects LTR and RTL langs).closes #3923