mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-23 22:33:57 +08:00
fix(caret): incorrect placement in tape mode
This commit is contained in:
parent
9858d93dc2
commit
981f9668c9
1 changed files with 8 additions and 1 deletions
|
@ -142,11 +142,18 @@ export async function updatePosition(noAnim = false): Promise<void> {
|
|||
newTop = activeWordEl.offsetTop + letterPosTop - caret.offsetHeight / 2;
|
||||
}
|
||||
|
||||
const newLeft =
|
||||
let newLeft =
|
||||
activeWordEl.offsetLeft +
|
||||
letterPosLeft -
|
||||
(fullWidthCaret ? 0 : caretWidth / 2);
|
||||
|
||||
const wordsWrapperWidth =
|
||||
$(document.querySelector("#wordsWrapper") as HTMLElement).width() ?? 0;
|
||||
|
||||
if (Config.tapeMode === "letter") {
|
||||
newLeft = wordsWrapperWidth / 2 - (fullWidthCaret ? 0 : caretWidth / 2);
|
||||
}
|
||||
|
||||
const newWidth = fullWidthCaret ? (letterWidth ?? 0) + "px" : "";
|
||||
|
||||
let smoothlinescroll = $("#words .smoothScroller").height();
|
||||
|
|
Loading…
Reference in a new issue