mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-13 19:04:06 +08:00
Merge 34350f1731 into 69cc227c87
This commit is contained in:
commit
1895670c18
1 changed files with 9 additions and 2 deletions
|
|
@ -405,8 +405,15 @@ export class Caret {
|
|||
isLanguageRightToLeft: boolean;
|
||||
isDirectionReversed: boolean;
|
||||
}): { left: number; top: number; width: number } {
|
||||
// in zen, custom or polyglot mode we need to check per-letter
|
||||
const checkRtlByLetter =
|
||||
Config.mode === "zen" ||
|
||||
Config.mode === "custom" ||
|
||||
Config.funbox.includes("polyglot");
|
||||
const [isWordRTL, isFullMatch] = isWordRightToLeft(
|
||||
options.wordText,
|
||||
checkRtlByLetter
|
||||
? (options.letter.native.textContent ?? "")
|
||||
: options.wordText,
|
||||
options.isLanguageRightToLeft,
|
||||
options.isDirectionReversed,
|
||||
);
|
||||
|
|
@ -455,7 +462,7 @@ export class Caret {
|
|||
|
||||
// yes, this is all super verbose, but its easier to maintain and understand
|
||||
if (isWordRTL) {
|
||||
if (isFullMatch) options.word.addClass("wordRtl");
|
||||
if (!checkRtlByLetter && isFullMatch) options.word.addClass("wordRtl");
|
||||
let afterLetterCorrection = 0;
|
||||
if (options.side === "afterLetter") {
|
||||
if (this.isFullWidth()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue