-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
impr(tape mode): support RTL languages (@NadAlaba) #5748
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 |
# Conflicts: # frontend/src/styles/test.scss # frontend/src/ts/test/test-ui.ts
# Conflicts: # frontend/src/ts/test/test-ui.ts
This PR is stale. Please trigger a re-run of the PR check action. |
This PR is stale. Please trigger a re-run of the PR check action. |
This PR is stale. Please trigger a re-run of the PR check action. |
Description
Other than the changes made in #5868, this PR has its changes in its last commit
impr(tape mode): support RTL languages (@NadAlaba)
which has the following changes:In
scrollTape()
:scrollTape()
to be async.#words
margin-left by putting#words
right edge in the center of#wordsWrapper
(newMargin = - wordsEl.offsetWidth + wordsWrapperWidth/2
), then put the first letter of the first word in that center (newMargin += wordRightMargin
), and finally add words widths instead of subtracting them like in LTR.scrollTape()
becomeing async requires? it to be awaited in where it is called which requires the calling functions to become async, and the chain continues. Functions that were changed to async:ConfigEvent.subscribe()
,updateActiveElement()
,updateWordWrapperClasses()
,showWords()
,updateWordsMargin()
, callback in#words.animate.complete()
inscrollTape()
.backspaceToPrevious()
, callback in$("#wordsInput").on("input")
.debouncedEvent()
.Subtract the width of the last letter that has a positive width if the current letter has a zero width (e.g, diacritics). This is needed when calculation is based on letter widths instead of letter position, which is done in caret.ts when tape=word, and in
scrollTape()
when tape=letter.Remove restriction on RTL tape mode from test-logic.ts.
closes #3923